Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

a current month tag?

Featured Replies

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

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

currentmonth= month(currentdate)

and currentyear= year(currentyear)

Bevin

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

  • 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>

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

  • Author

That's elegant!

thanks.

Create an account or sign in to comment

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.