Page 1 of 1

Format Dates in html_reports

PostPosted: Wed Aug 29, 2012 6:11 pm
by shardison
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')}

Re: Format Dates in html_reports

PostPosted: Sat Sep 08, 2012 10:09 am
by shannah
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