Project

General

Profile

Actions

Bug #102070

open

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

Added by Georg Tiefenbrunn 7 months ago.

Status:
New
Priority:
Should have
Assignee:
-
Category:
FormEngine aka TCEforms
Target version:
-
Start date:
2023-09-29
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
12
PHP Version:
8.2
Tags:
Complexity:
Is Regression:
Sprint Focus:

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

Related issues 1 (1 open0 closed)

Related to TYPO3 Core - Bug #101254: Date field validated as incorrect when range.lower is set and setting a date in the futureNew2023-07-05

Actions
Actions #1

Updated by Georg Tiefenbrunn 7 months ago

  • Related to Bug #101254: Date field validated as incorrect when range.lower is set and setting a date in the future added
Actions

Also available in: Atom PDF