[Typo3] Typo3-english Digest, Vol 20, Issue 185

Marcel Douwstra marcel.douwstra at tros.nl
Wed Jul 20 17:43:51 CEST 2005


I'm having the exact same problem unfortunately. Christophers solution,  
allthough very plausible, also didn't work for me.
I also would like to stay away from editing the t3lib classes since  
that makes upgrading to new typo3 versions a pain.

Does anyone else have a solution for me that does not need me to change  
t3lib classes?

Thanx a lot!


*** TYPO3 FORUM: http://typo3.tros.nl ***

Op 31-mei-05 om 8:35 heeft typo3-english-request at lists.netfielders.de  
het volgende geschreven:

> From: Pieter Jelle <pieter.jelle at invalid.invalid>
> Subject: Re: [Typo3] date as label-field shows seconds sinds epoch
> 	instead	of   formatted date
> To: typo3-english at lists.netfielders.de
> Message-ID:
> 	<mailman.1.1117504421.21256.typo3-english at lists.netfielders.de>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
> Christopher wrote:
>> Hi,
>> On 5/30/05, Pieter Jelle <pieter.jelle at invalid.invalid> wrote:
>>> Hello all
>>> An extension I've written myself for a theatre uses a date record to
>>> represent the playing dates of a certain show, and these date records
>>> are linked to a show record. However, I use the date field (which is  
>>> the
>>> only field for this record) as the label field for the backend, but  
>>> in
>>> the backend these records are listed as seconds since the epoch  
>>> (which
>>> is the way the record is stored in the database) instead of a  
>>> formatted
>>> date. See http://statik.be/misc/shows.gif for an example.
>>> For the people using the backend of course this is rather confusing,  
>>> and
>>> I would like a formatted date to be shown, and have been looking in  
>>> the
>>> Typo3 source to change this myself but couldn't find a way to do  
>>> this.
>>> Can anyone suggest where and what to change to get this to show
>>> correctly or has anyone got another idea? Thanks in advance!
>>> (I have searched the archives and found this problem being mentioned,
>>> but no solution.)
>> I think what you need is the API doc [1]. See 'eval' and 'checkbox' in
>> part 4.2.5 ['columns'][fieldname]['config'] / TYPE: "input" of the TCA
>> section [2].
> I checked those, but those were set correctly in tca.php of my
> extension. However, after an hour of digging in the source, I finally
> fixed it by adding a switch to the function getRecordTitle in
> class.t3lib_befunc.php. Just before the return $t I added this piece of
> code :
> $eval =
> $TCA[$table]['columns'][$TCA[$table]['ctrl']['label']]['config']['eval' 
> ];
> switch($eval) {
> 	case 'date':
> 		$t = date("j-n-Y", $t);
> 	break;
> 	default:
> 	break;
> }
> it can be extended with other eval types which need special treatment,
> but this works fine for me. Hope this is helpful to someone with the
> same problem.
> Regards
> PJ

More information about the TYPO3-english mailing list