October 3, 200223 yr Hi, i have some pages that show the current month calendar when you go into them. I'm generating the url using SSI, so the code looks like: blah blah&-op=eq&monthlink=<!--#config timefmt='%B %Y'--> <!--#echo var='date_local'-->&-find which nicely returns blah blah&-op=eq&monthlink=october 2002&-find Can I use a Filemaker tag instead so that it's independent of the webserver? I can find [FMP:currentdate] and even [FMP:currentday] but I want a 'current month, current year' thanks, jeff
October 3, 200223 yr Sure, you can have a status(currentdate) function, named "currentdate," then also define the fields: currentmonth= month(currentdate) and currentyear= year(currentyear) Bevin
October 3, 200223 yr You could also use some Javascript. Which, of course, is client side. Alternatively, Javascript could be used to parse the [FMP-CurrentDate] replacement tag. All the best. Garry
October 4, 200223 yr Author Hi, thanks for that - Yes, I'll go the javascript route and write in the month and year. I did the SSI originally so that I wasn't using a calulated field based on the 'moving target' of the current date. thanks, jeff this is what I've ended up with, I suspect that it's not an elegant way to write Javascript, but it's my best effort! thanks, jeff <HTML> <HEAD> <SCRIPT LANGUAGE=JavaScript>var now = new Date(); var months = new Array('January','February','March','April','May','June','July','August','September','October','November','December'); function fourdigits(number) { return (number< 1000) ? number + 1900 number; } today = months[now.getMonth()] +" "+(fourdigits(now.getYear())) ;</SCRIPT> </HEAD> <BODY BGCOLOR="#FFFFFF"> <P><FONT SIZE="+1"><B><SCRIPT LANGUAGE=JavaScript>document.write('<A HREF="http://localhost:591/displaystand/FMPro?-db=calendardisplay3&-lay=visit&-format=month.htm&-sortfield=weeknumber&-sortorder=ascend&-op=eq&monthlink=',today,'&-find">Link')</SCRIPT></B></FONT></P> </BODY> </HTML>
October 4, 200223 yr Jeff, You can use "now.getFullYear()" for the four digit year. So the code would look like this: today = months[now.getMonth()] + " " + now.getFullYear(); and document.write('<A HREF="http://localhost:591/displaystand/FMPro?-db=calendardisplay3&-lay=visit&-format=month.htm&-sortfield=weeknumber&-sortorder=ascend&-op=eq&monthlink=' + today + '&-find">');</SCRIPT>Link</a> All the best. Garry
Create an account or sign in to comment