Jeff Spall Posted October 3, 2002 Posted October 3, 2002 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
CyberSport Posted October 3, 2002 Posted October 3, 2002 Sure, you can have a status(currentdate) function, named "currentdate," then also define the fields: currentmonth= month(currentdate) and currentyear= year(currentyear) Bevin
Garry Claridge Posted October 3, 2002 Posted October 3, 2002 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
Jeff Spall Posted October 4, 2002 Author Posted October 4, 2002 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>
Garry Claridge Posted October 4, 2002 Posted October 4, 2002 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
Recommended Posts
This topic is 8187 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now