Evolvee
Evolvee

Reputation: 13

How to configure (Date)Timepicker in TYPO3 12 Backend

I'm trying to configure the new Datetimepicker(Flatpickr) introduced in the TYPO3 Backend. By default the time is picked with AM/PM but I want to use a 24h Timepicker. I don't see how to configure Flatpickr in the Backend.

My TCA Config:

'event_starttime' => [
    'label' => $ll . 'tx_mvevents_domain_model_event.starttime',
    'l10n_mode' => 'exclude',
    'l10n_display' => 'defaultAsReadonly',
    'config' => [
        'type' => 'datetime',
        'format' => 'time',
        'eval' => 'int',
        'default' => '1970-01-01T00:00:00Z',
        'required' => 1,
    ]
],

Upvotes: 1

Views: 431

Answers (2)

MAZ
MAZ

Reputation: 214

To use a 24h Timepicker, edit this file:

\typo3\sysext\backend\Classes\Form\Element\InputDateTimeElement.php:135

Find:

'data-formengine-input-name' => $parameterArray['itemFormElName'],

below adds:

'data-enabletime' => 'true',
'data-time_24hr' => 'true',

Save and refresh your BE cache.

Upvotes: -3

Henrik Ziegenhain
Henrik Ziegenhain

Reputation: 46

No solution, for now, but this is a bug, I reported recently to TYPO3 Issue Tracker.

https://forge.typo3.org/issues/99768

Upvotes: 3

Related Questions