Forums / Setup & design / Custom datetime for attribute

Custom datetime for attribute

Author Message

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 Bolger
Alice 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.

Cheers
Bruce

My Blog: http://www.stuffandcontent.com/
Follow me on twitter: http://twitter.com/brucemorrison
Consolidated eZ Publish Feed : http://friendfeed.com/rooms/ez-publish

paul bolger

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?

regards
Paul Bolger

Paul Bolger

Bruce Morrison

Thursday 26 April 2007 8:25:42 pm

Hi Paul

So, 'data_int' returns the system date string instead of the default formatted date? 

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)}

Cheers
Bruce

My Blog: http://www.stuffandcontent.com/
Follow me on twitter: http://twitter.com/brucemorrison
Consolidated eZ Publish Feed : http://friendfeed.com/rooms/ez-publish

paul bolger

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

Paul Bolger

eZ debug

Timing: Jan 18 2025 21:17:36
Script start
Timing: Jan 18 2025 21:17:36
Module start 'content'
Timing: Jan 18 2025 21:17:37
Module end 'content'
Timing: Jan 18 2025 21:17:37
Script end

Main resources:

Total runtime0.8502 sec
Peak memory usage4,096.0000 KB
Database Queries64

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0061 587.7109180.8359
Module start 'content' 0.00610.8403 768.5469573.2578
Module end 'content' 0.84640.0037 1,341.804746.1094
Script end 0.8502  1,387.9141 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00280.3326140.0002
Check MTime0.00120.1450140.0001
Mysql Total
Database connection0.00080.099710.0008
Mysqli_queries0.798493.9061640.0125
Looping result0.00050.0632620.0000
Template Total0.823996.920.4120
Template load0.00200.236820.0010
Template processing0.821996.669120.4109
Template load and register function0.00010.009810.0001
states
state_id_array0.00130.148810.0013
state_identifier_array0.00070.078520.0003
Override
Cache load0.00180.2074360.0000
Sytem overhead
Fetch class attribute can translate value0.00090.104720.0004
Fetch class attribute name0.00140.159670.0002
XML
Image XML parsing0.00110.127320.0005
class_abstraction
Instantiating content class attribute0.00000.0022100.0000
General
dbfile0.00120.1353240.0000
String conversion0.00000.001030.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
5content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
5content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
12content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
4content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
4content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 32
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs