Forums / Setup & design / Date formatting

Date formatting

Author Message

Daniele Turcato

Friday 25 July 2003 1:55:35 pm

I would want to print the date in this format: 25.07.2003 but I do not succeed to us. I have read other messages and I have tried in this way:

{attribute_view_gui attribute=$Child:item.data_map.data|datetime(custom,"%d %m %Y";)}

but it does not work and it prints always 2003.07.25 Someone can help me?
Thanks

english by google ;-)

Alex Jones

Friday 25 July 2003 2:05:52 pm

If you are familiar with PHP you can try to edit the ezdate datatype directly to make your change - or perhaps create a new datatype from a copy of ezdate (recommended). The datatype is in kernel/classes/datatypes/ezdate/

Alex

Alex
[ bald_technologist on the IRC channel (irc.freenode.net): #eZpublish ]

<i>When in doubt, clear the cache.</i>

Daniele Turcato

Friday 25 July 2003 2:22:21 pm

Thanks a lot Alex

Daniele Turcato

Friday 25 July 2003 2:35:26 pm

to modify the class is too much complicated for me, exists an other way?

Thanks

liu spider

Saturday 26 July 2003 3:38:44 am

edit your language file under share/locale/

eg. you use united kingdom english, then you should edit share/locale/eng-GB.ini

in that file, find section DateTime, and you'll understand

http://liucougar.scim-im.org
SCIM Input Method Platform
http://scim.sf.net
SJSD Online Editor
http://sf.net/projects/sjsd

Jan Borsodi

Saturday 26 July 2003 4:05:39 am

The output of the date datatype is controlled by the template content/datatype/view/ezdate.tpl (in design/standard/templates). Copy it to your own design and change the contents.
Example code:

{section show=$attribute.content.is_valid}{$attribute.content.timestamp|datetime(custom,"%d %m %Y")}{/section}

Also to clear up some misunderstandings in your code.
The expression $Child:item.data_map.data will return an object of the type eZContentObjectAttribute and cannot be converted directly to a date string. The datetime (or l10n(date) ) operator will only work on timestamps which are simple integers (number).
And also the ; (semicolon) after your string will probably make the template parser complain.

--
Amos

Documentation: http://ez.no/ez_publish/documentation
FAQ: http://ez.no/ez_publish/documentation/faq

Christian Lundvang

Tuesday 29 July 2003 2:24:43 am

Hi.

I've got, somewhat, the same problem. I am listing out some articles, and I wish to show when they where published. I have a datefield in my class which is called "publisert". I use this:
{$Child:item.data_map.publisert}, but this gives me a date in 1970!?!

Thanks in advance

--
Best Regards
Christian Lundvang
http://www.nxc.no

Christian Lundvang

Tuesday 29 July 2003 2:42:05 am

Found it!

{$Child:item.data_map.publisert.data_int|l10n(date)}

Thanks to Richard Wood.

--
Best Regards
Christian Lundvang
http://www.nxc.no

eZ debug

Timing: Jan 18 2025 15:56:37
Script start
Timing: Jan 18 2025 15:56:37
Module start 'content'
Timing: Jan 18 2025 15:56:38
Module end 'content'
Timing: Jan 18 2025 15:56:38
Script end

Main resources:

Total runtime1.5704 sec
Peak memory usage4,096.0000 KB
Database Queries215

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0078 588.7188180.8516
Module start 'content' 0.00781.4366 769.5703715.1328
Module end 'content' 1.44450.1259 1,484.7031340.4688
Script end 1.5704  1,825.1719 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00370.2375210.0002
Check MTime0.00140.0892210.0001
Mysql Total
Database connection0.00120.076110.0012
Mysqli_queries1.488794.79512150.0069
Looping result0.00200.12932130.0000
Template Total1.539098.020.7695
Template load0.00210.134020.0011
Template processing1.536997.863620.7684
Template load and register function0.00010.009510.0001
states
state_id_array0.00150.096710.0015
state_identifier_array0.00090.055320.0004
Override
Cache load0.00210.1367410.0001
Sytem overhead
Fetch class attribute can translate value0.00130.085260.0002
Fetch class attribute name0.00100.0612120.0001
XML
Image XML parsing0.00200.127460.0003
class_abstraction
Instantiating content class attribute0.00000.0013130.0000
General
dbfile0.00560.3569460.0001
String conversion0.00000.000230.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

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
8content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
11content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
4content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
5content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 30
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs