Issue Bug Closed

#106937TCA Datetime with different outputs depending on the “readonly” status

Thomas Rokohl 06/23/25, 18:28 updated 12/02/25, 14:27

Description

If you create a datetime entry in the TCA, you get different outputs depending on whether readonly = true or not.

If readonly is true the element render the date with php and add the timezone to the output.(in my case UTC+2)
If readonly is false, the element will display the date in a data attribute that contains the timestamp UTC+0.

Test TCA:

 [
  'exclude' => true,
  'label' => Test',
  'config' => [
    'type' => 'datetime',
    'default' => null,
    'size' => 30,
    'readOnly' => true,
    'dbType' => 'datetime',
    'nullable' => true,
  ],
],
'readOnly' => true, => 19:40
'readOnly' => false => 17:40

Reviews 2