Review main Merged

86701[BUGFIX] Use correct dataset identifier for date ranges

Andreas Kienast CR +2 V +2 Easy +16 −13 updated 10/30/24, 11:54

Commit message

Datetime fields can be configured to set a minimum date and a maximum
date. This apparently broke with the migration to flatpickr, which
dropped jQuery in the same run.

The data attributes are named `data-date-min-date` and
`data-date-max-date`, and therefore the dataset accessor must be
correctly camel-cased. Configured date ranges are transformed to valid
JavaScript `Date` objects and fed into flatpickr.

To ensure consistent date handling, the min and max range values
are now parsed into server localtime, to coincide with how
the date values are handled since #104309.

Also, a minor CSS bug is fixed that makes disallowed dates
distinguishable from dates in another months.

Review

  • Code review CR +2 Done
    • Benjamin Franzke +2
    • Garvin Hicking +1
  • Verified V +2 Done
    • Benjamin Franzke +2
    • Garvin Hicking +1
    • core-ci +1 CI

Issues 2

Files 5

Review log 1215

  1. Andreas Kienast uploaded patch set 1 10/23/24, 06:45

  2. core-ci voted on patch set 1 V -1 10/23/24, 06:54 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/68427

  3. Andreas Kienast uploaded patch set 2 V -1 10/23/24, 07:24

  4. core-ci voted on patch set 2 V +1 10/23/24, 07:31 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/68429

  5. Garvin Hicking voted on patch set 2 CR +1 V +1 10/24/24, 07:56

  6. Simon Schaufelberger voted on patch set 2 CR +1 V +1 10/28/24, 11:55

  7. Benjamin Franzke commented on patch set 2 CR -1 10/29/24, 12:51

    date-time-picker.ts:268

    I'm pretty sure we need to convert to a localtime DateTime string on the server side (encoded into a fake UTC-0), as the frontend (our JS) does not know what the server localtime is. The current code would only work if server timezone and user agent timezone matches (which we must not rely on). I can not estimate if this every worked properly, so I'm not sure about backports. but as it seems it's not working at all right now, we're probably fine to change it to be entirely correct.
  8. Benjamin Franzke commented on patch set 2 10/29/24, 13:22

    date-time-picker.ts:268 Reply

    Can easily tested by setting the value manually to the min value in the database, e.g. for the `inputdatetime_34` which is configured to have `1627208536` as min. That is in UTC: So 25. Jul 10:22:16 UTC 2021 ``` update tx_styleguide_elements_basic set inputdatetime_34 = 1627208536 where uid = 1; ``` When loading FormEngine on a server with timezone=UTC and a client with `timezone=Europe/Berlin`, the min value will be discarded and as the min value is interpreted as ``` So 25. Jul 12:22:16 CEST 2021 ``` Instead of ``` So 25. Jul 10:22:16 UTC 2021 ``` The client only allows to enter >= 12:22 instead of > 10:22 on the 25th of july 2021.
  9. Benjamin Franzke uploaded patch set 3 CR +1 V +1 10/29/24, 16:05

  10. Benjamin Franzke commented on patch set 3 10/29/24, 16:05

    date-time-picker.ts:268 Reply

    Done
  11. Benjamin Franzke voted on patch set 3 CR +1 V +1 10/29/24, 16:06

  12. core-ci voted on patch set 3 V +1 10/29/24, 16:12 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/68796

  13. Garvin Hicking voted on patch set 3 CR +1 V +1 10/30/24, 09:40

  14. Benjamin Franzke voted on patch set 3 CR +2 V +2 10/30/24, 11:46

  15. Benjamin Franzke merged patch set 4 10/30/24, 11:54