Author Topic

Carlos Revillo

Tuesday 12 January 2010 2:58:53 pm

Comment56578

you can also control the format doing a little hack. please correct me if i'm wrong.

if your date is datetime type, you can take a look at

kernel/classes/datatypes/ezdatetime/ezdatetimetype.php

There you'll find a function called title. Here's the code

function title( $contentObjectAttribute, $name = null )
{
 $locale = eZLocale::instance();
 $retVal
= $contentObjectAttribute->attribute( "data_int" ) == 0 ? '' :
$locale->formatDateTime( $contentObjectAttribute->attribute(
"data_int" ) );
 return $retVal;
}

you can modify that function and adjust $retVal to whatever you want.

Same goes for ezdate or eztime (or all of datatypes, i think)

if you prefer not to hack that file, you can create your own datatype, starting from the provided one.

Cheers.