Forums / Setup & design / Custom datetime for attribute
paul bolger
Wednesday 25 April 2007 9:49:24 pm
I have a content class with an attribute 'date_of_meeting'. I'm trying to format the output:
{attribute_view_gui attribute=$node.object.data_map.date_of_meeting|datetime( 'custom', '%l %j %F %Y' )}
I've tried every permutation I can think of, but nothing seems to work. Can anyone help me out?
thanks
Paul BolgerAlice Springs Town Council
Paul Bolger
Bruce Morrison
Wednesday 25 April 2007 11:24:47 pm
Hi Paul
Try (untested)
{$node.object.data_map.date_of_meeting.data_int|datetime( 'custom', '%l %j %F %Y' )}
P.S. Have a look at the default datatype view template for clues.
CheersBruce
My Blog: http://www.stuffandcontent.com/ Follow me on twitter: http://twitter.com/brucemorrison Consolidated eZ Publish Feed : http://friendfeed.com/rooms/ez-publish
Thursday 26 April 2007 7:24:03 pm
Hi Bruce. That works, thanks.
So, 'data_int' returns the system date string instead of the default formatted date?
regardsPaul Bolger
Thursday 26 April 2007 8:25:42 pm
Kind of. Different datatypes store their "raw" values in different places. "content" usually stores the data that is used for output.
As I mentioned, the default datatype view templates are a good source to find where info is stored and how it is displayed. the "attribute" template function is also a good way .e.g
{node.object.data_map.date_of_meeting|attribute(show,2)}
Thursday 26 April 2007 11:10:07 pm
Ah yes, the 'attribute' function. I encountered that yesterday playing around with the weather extension (great idea, pity about the source data...)
Script start
Module start 'content'
Module end 'content'
Script end
Time used to render debug report: 0.0001 secs