Skip 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.

Does Status(CurrentDate) work properly with CDML?

Featured Replies

This topic originated in "Left Brain" (at http://www.fmforums.com/ubb/Forum45/HTML/000148.html) but seems more appropriate at this point to be here in CDML. I hope I'm not messing up by cross posting...

Does anyone know for sure if Status(CurrentDate) will update automatically when called from a format file in an instance such as this:

<IMG SRC="[FMP-Field: Absolute_URL]">

Where I want the image to change daily and the field Date is a calculation that returns a text date and a path to the image for the day using this field Date_Today to determine the day:

LeftWords(DateToText(Status(CurrentDate)), 1) &

MiddleWords(DateToText(Status(CurrentDate)), 2, 1) &

RightWords(DateToText(Status(CurrentDate)), 1)

This gives me a date such as 2222001 which I then append a .gif to (with a field called gFileExtension) and put the rest of the absolute URL in using a field called gServer like so:

gServer & "/" & RightWords(DateToText(Status(CurrentDate)), 1) & "/"

& MonthName(Status(CurrentDate)) & "/"

& Date_Today & gFileExtension

This returns a result (an absolute path name to the image) in the format file essentially like this that should change on a day to day basis:

<IMG SRC="http://www.servername.com/February/2222001.gif">

So, ultimately does this reliably and accurately return the correct date from that original Status(CurrentDate) calculation?

Cael.

A couple of things as I come across them:

the calculation for the datename of the image: what is 1112001 - the November 1 or January 11? I'd change the algorithm to put in leading zeros: 01112001 this will make it much easier to read and parse.

Actually a better algorithm for the date number thing would be:

Day(Status(CurrentDate)) & Month(Status(CurrentDate)) & Year(Status(CurrentDate))

for a calc that included the leading zeros:

Case(Day(Status(CurrentDate)) < 10, "0") & Day(Status(CurrentDate)) &

Case(Month(Status(CurrentDate)) < 10, "0") & Month(Status(CurrentDate)) &

Year(Status(CurrentDate))

I'd maybe suggest that it be put into the format yyymmdd since this sorts much nicer.

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

Search

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.