Format Dates in html_reports

A place for users and developers of the Xataface to discuss and receive support.

Format Dates in html_reports

Postby shardison » Wed Aug 29, 2012 6:11 pm

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

<a href="http://localhost:8888/ccap2012/index.php?-action=new&amp;-table=dataface__htmlreports_reports#">&nbsp;{$application_date}</a>


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')}
shardison
 
Posts: 24
Joined: Wed Aug 08, 2012 12:09 pm

Re: Format Dates in html_reports

Postby 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
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm


Return to Xataface Users

Who is online

Users browsing this forum: No registered users and 26 guests

Powered by Dataface
© 2005-2007 Steve Hannah All rights reserved