Cannot store 12:00 AM in TimeRangeWidget - replaced with NULL

Created on 9 September 2025, 28 days ago

Problem/Motivation

Since 🐛 The integer 86401 should not be used to represent an "empty" time element Active we can no longer set 12:00 AM or 00:00 in 24h format as start or end in a TimeRangeWidget.
The value is replaced with NULL.

Steps to reproduce

Create a node type with a time range field. Use TimeRangeWidget in the form display.
Set start or end time to 12:00 AM or 00:00 in 24h format. Save.

Expected:
Start or end time is saved as 12:00 AM (midnight).

Actual:
Start or end time is saved as NULL (not set).
If the field is required, we see "This value should not be null.".

(Note: I am continental European, I think AM / PM notation is silly, but whatever),

Proposed resolution

Instead of empty($value), check ($value ?? '') !== ''.
Add a test case that sets 12:00 AM.

Remaining tasks

Also review other code if it properly distinguishes NULL vs 00:00 / 12:00 AM.

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Active

Version

2.2

Component

Miscellaneous

Created by

🇩🇪Germany donquixote

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