Support for the field setting "Date Only".

Created on 29 February 2024, 10 months ago
Updated 12 September 2024, 3 months ago

Problem/Motivation

When using the bootstrap_datetime_picker module with a field set to "Only Date," warnings are displayed upon saving the form. While the form submission does not fail, the warnings indicate issues with the module's behavior.

Warning: Undefined array key "#date_time_element" in Drupal\Core\Datetime\Element\Datetime::validateDatetime() (line 356 of core/lib/Drupal/Core/Datetime/Element/Datetime.php).
Warning: Undefined array key "#date_time_element" in Drupal\Core\Datetime\Element\Datetime::getHtml5TimeFormat() (line 441 of core/lib/Drupal/Core/Datetime/Element/Datetime.php).
Warning: Undefined array key "#date_time_format" in Drupal\Core\Datetime\Element\Datetime::getHtml5TimeFormat() (line 446 of core/lib/Drupal/Core/Datetime/Element/Datetime.php).

Steps to reproduce

1. Define a Date type field.
2. Set the field configuration to "Only Date."
3. Execute the form for the corresponding Entity.

Proposed resolution

It seems that when the field configuration is set to "Only Date," the module still renders a UI allowing time selection, which may not be appropriate. The proposed resolution is to adjust the module's behavior so that it appropriately handles fields configured as "Only Date" without rendering the time selection UI.

Remaining tasks

- Further investigation into the bootstrap_datetime_picker module's handling of fields set to "Only Date."
- Implementation of changes to ensure the module behaves as expected when used with fields configured as "Only Date."

User interface changes

Adjustments will be made to ensure that the time selection UI is not rendered when the field configuration is set to "Only Date."

📌 Task
Status

Fixed

Version

4.0

Component

Code

Created by

🇯🇵Japan umekikazuya

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024