Format Dates in html_reports

Archived from the Xataface Users forum.

shardison — Wed Aug 29, 2012 6:11 pm

This is the following code for a date field in a report I made

 {$application_date}

currently $application_date yields the date and time. I would like to format it to yield Month, DD, YYYY (ex July 15, 2012)
I suspect there is a format function I could put between the { } but I do not know the syntax.
Something like date_format($application_date,’m,d,Y’)}


shannah — Sat Sep 08, 2012 10:09 am

There are a few template expressions that haven’t been documented yet. They include:
if
strtolower
year
month
day
strftime

Usage examples:

{% {$isNew} if : New : Old %}

– Above example outputs the string “New” if the isNew field is non empty and the string “Old” if it is empty.

{% {$firstname} strtolower %}

– Outputs the firstname field converted to lowercase.

{% {$date} year %}

– Outputs the 4 digit year portion of the date field

{% {$date} month %}

– Outputs the 2 digit month number of the date field

{% {$date} day %}

– Outputs the 2 digit day number of the date field

{% {$date} strftime : %A %}

– Outputs the day of the week (e.g. Sunday) for the given date.
strftime can take the same format parameters as the php strftime function
http://ca2.php.net/strftime

-Steve