Deprecation: #109152 - Form DatePicker element
See forge#109152
Description
The
Date form element type and its associated
Date and
Time have been
deprecated in favor of removing the jQuery dependency from
typo3/cms-form
.
The
Date form element type serves as replacement and uses a native
HTML5
<input type="date"> without any JavaScript library.
The following components are deprecated:
\TYPO3\CMS\ Form\ Domain\ Model\ Form Elements\ Date Picker \TYPO3\CMS\ Form\ View Helpers\ Form\ Date Picker View Helper \TYPO3\CMS\ Form\ View Helpers\ Form\ Time Picker View Helper - The
EXT:jQuery initialization scriptform/ Resources/ Public/ Java Script/ frontend/ date- picker. js
Impact
Using the
Date form element type in a form definition will
trigger a PHP
E_ level error at runtime.
The element, its ViewHelpers and the JavaScript file will be removed with
TYPO3 v15.
Affected installations
All installations that use the
Date form element type in form
definitions created with the TYPO3 Form Framework.
Migration
Replace
Date with the
Date form element type in your
form definitions.
Before:
type: DatePicker
identifier: date-1
label: 'Pick a date'
properties:
dateFormat: Y-m-d
enableDatePicker: true
After:
type: Date
identifier: date-1
label: 'Pick a date'
The
Date element uses a native HTML5 date input which does not require
jQuery or any additional JavaScript. The
date and
enable properties are no longer needed because the browser
handles date formatting and the picker natively.
Alternatively, if the native HTML5 date input does not meet your requirements, you can create a custom form element with a date picker JavaScript library of your choice.