[TYPO3-core] RFC: Bug #4515: Date fields displayed wrong in TCEforms

Ernesto Baschny [cron IT] ernst at cron-it.de
Wed Nov 15 09:57:34 CET 2006


Michael Stucki schrieb:
> This is a SVN patch request.
> 
> Problem:
> Input fields with TCA setting "eval" => "date" and "readOnly" => 1 will 
> display a wrong date if they are empty.
> 
> Solution:
> If the input value is undefined (zero), display an empty string.
> 
> Branches: TYPO3_4-0 & Trunk

+1 from me too, but with some modifications:

I just don't agree with that part:
-                                               $value =
date($option,$itemValue);
+                                               $value =
date('d-m-Y',$itemValue);

Why are you not using $option anymore? I don't know where this
$config['format.']['option'] comes from, is it documented somewhere? Can
this be set through TCA? How?

And while you are at it, the same problem arises if the format is
datetime, time, timesec and year. So I would propose to simplify the
patch by doing right before the switch something like:

if (!$itemValue && in_array($format, array('date', 'datetime', 'time',
'timesec', 'year'))) {
   return '';
}

Cheers,
Ernesto



More information about the TYPO3-team-core mailing list