Forums / Developer / Date datatype formating

Date datatype formating

Author Message

Brendan Pike

Monday 19 May 2003 9:42:34 pm

In a template I currently use
{attribute_view_gui attribute=$content_version.data_map.dateline}
Which produces 2002.12.20 or whatever the user placed in the fields.

My question is can I format these to look like
Friday 20 December 2002

I tried
{attribute_view_gui attribute=$content_version.data_map.dateline.data_int|l10n(date)}
and similar variables without luck.

Can anyone help?

www.dbinformatics.com.au

We are always interested in hearing from experienced eZ PHP programmers and eZ template designers interested in contract work.

Selmah Maxim

Tuesday 20 May 2003 12:34:42 am

Hi ..

tyr this :

{attribute_view_gui attribute=$content_version.data_map.dateline.data_int|l10n(datetime(custom,"%l %d %F %Y")} )}

look at SDK Date : sdk/eztemplate/view/operator_list/

and at php.net :
http://www.php.net/manual/en/function.date.php

Brendan Pike

Tuesday 20 May 2003 4:53:05 am

Thanks for the suggestion but it didn't work. I tried lots of variables of your suggestion but without result. It usually doesn't show anything or simply outputs the same numerical dates.

Still open for suggsetions though :)

www.dbinformatics.com.au

We are always interested in hearing from experienced eZ PHP programmers and eZ template designers interested in contract work.

Selmah Maxim

Tuesday 20 May 2003 9:59:51 am

as i unserstand from ur 1st post, that date format what ur have is 2002.12.20, then u will need to convert it to timestamp to use this option in the template language !
try this

{$content_version.data_map.published|datetime(custom,"%l %d %F %Y")}

if u got as u want, then ok, if not then u need to translate the date in the local files/ files maybe !

Brendan Pike

Thursday 22 May 2003 9:28:40 am

Thanks for everyones help. For anybody with similar challenges the solutiuon ended up looking like this:

{section show=count($content_version.data_map.dateline.data_int)|gt(1)}
{$content_version.data_map.dateline|l10n(date)}

www.dbinformatics.com.au

We are always interested in hearing from experienced eZ PHP programmers and eZ template designers interested in contract work.