Date formatting

Date formatting

Friday 25 July 2003 1:55:35 pm - 7 replies

Author Message

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

You must be logged in to post messages in this topic!

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.