Issue Bug Closed

#102070Validation and UX errors on TCA type=datetime when using range property

Georg Tiefenbrunn 09/29/23, 13:56 updated 11/13/26, 13:21

Description

Use the following TCA type datetime to reproduce:

'date_column' => [
    'label' => 'date_column',
    'config' => [
        'type' => 'datetime',
        'format' => 'date',
        'default' => 0,
        'range' => [
            'lower' => 1693526400,
            'upper' => 1693699200,
        ],
    ],
],
lower = 1693526400 = 2023-09-01 (Fri Sep 01 2023 00:00:00 GMT+0000)
upper = 1693699200 = 2023-09-03 (Sun Sep 03 2023 00:00:00 GMT+0000)

Date 2023-09-02 (input value 02-09-2023 in BE form field) should be valid for each range combinations (both range.lower and range.upper or only one of them). The following errors also occur using 'format' => 'datetime'.

As soon as range.lower is used (both used alone or in combination with range.upper), all inputs are reported invalid (JS, form can’t be saved).

If only range.upper is used …

  • record can be saved
  • there is no JS validation
  • invalid values (e.g. 04-09-2023) will be converted to the given upper limit 30-09-2023 ignoring its time (the current time is used).

As an integrator …

  • I expect the BE to properly validate user input as defined in TCA
  • I expect server side transformation of user input to be stored with the given min/max time (not a weird mix of current and min/max datetime)

As an editor …

  • I expect invalid dates being disabled in the date picker

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.

History 4

  1. Benni Mack commented and changed status New Closed <span data-processor="relativetime" data-value="2026-11-13T13:21:46+00:00" > 11/13/26, 13:21 </span>

    Fixed with #105430