Jump to content

This topic is 8187 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

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

Posted

Sure, you can have a status(currentdate) function, named "currentdate," then also define the fields:

currentmonth= month(currentdate)

and currentyear= year(currentyear)

Bevin

Posted

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>

Posted

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.