Deprecation: #109152 - Form DatePicker element 

See forge#109152

Description 

The DatePicker form element type and its associated DatePickerViewHelper and TimePickerViewHelper 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\FormElements\DatePicker
  • \TYPO3\CMS\Form\ViewHelpers\Form\DatePickerViewHelper
  • \TYPO3\CMS\Form\ViewHelpers\Form\TimePickerViewHelper
  • The EXT:form/Resources/Public/JavaScript/frontend/date-picker.js jQuery initialization script

Impact 

Using the DatePicker form element type in a form definition will trigger a PHP E_USER_DEPRECATED 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 DatePicker form element type in form definitions created with the TYPO3 Form Framework.

Migration 

Replace DatePicker 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
Copied!

After:

type: Date
identifier: date-1
label: 'Pick a date'
Copied!

The Date element uses a native HTML5 date input which does not require jQuery or any additional JavaScript. The dateFormat and enableDatePicker 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.