Review main Merged

92994[FEATURE] Support relative date formats in ext:form

Josua Vogel CR +2 V +2 Hard +559 −12 updated 03/02/26, 20:31

Commit message

The DateRange validator and the default value of a Datepicker element
now support relative date expressions (e.g. "today", "-18 years", "+1 month")
in addition to absolute dates in Y-m-d format.

- DateRangeValidator uses date_create() instead of
  DateTime::createFromFormat() to parse both absolute and relative
  date expressions at validation time.
- FormatDateRenderableBeforeRendering resolves
  relative min/max HTML attributes to absolute Y-m-d dates at
  rendering time, as required by the HTML5 date input spec.

Review

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

Issues 1

Files 9

Review log 1930

Show 35 earlier messages
  1. Josua Vogel uploaded patch set 1 02/25/26, 13:00

  2. core-ci voted on patch set 1 V -1 02/25/26, 13:11 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/96821

  3. Josua Vogel marked it work in progress 02/25/26, 13:33

  4. Josua Vogel uploaded patch set 2 V -1 02/25/26, 14:20

  5. core-ci voted on patch set 2 V -1 02/25/26, 14:31 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/96825

  1. Josua Vogel uploaded patch set 3 V -1 02/25/26, 14:42

  2. Josua Vogel marked it ready for review 02/25/26, 14:46

  3. Josua Vogel commented on patch set 3 02/25/26, 14:51

    Please also take a look at the related ticket regarding an improvement to the UI.
  4. core-ci voted on patch set 3 V -1 02/25/26, 14:55 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/96827

  5. Josua Vogel rebased onto patch set 4 V -1 02/25/26, 14:59

  6. core-ci voted on patch set 4 V -1 02/25/26, 15:37 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/96829

  7. core-ci voted on patch set 4 V +1 02/25/26, 15:59 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/96829

  8. Josua Vogel updated the commit message in patch set 5 V +1 02/26/26, 10:28

  9. core-ci voted on patch set 5 V +1 02/26/26, 10:39 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/96898

  10. Josua Vogel rebased onto patch set 6 V +1 03/01/26, 12:33

  11. core-ci voted on patch set 6 V +1 03/01/26, 12:45 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/97071

  12. Garvin Hicking commented on patch set 6 03/01/26, 13:41

    FormatDateRenderableBeforeRendering.php:26

    Why is the PHP and JS pattern different?

    FormatDateRenderableBeforeRendering.php:32

    I think we should harmonize this somehow, maybe pass it as data/lit arguments from PHP to JS to have it at a central place and not twice?

    DateRangeValidator.php:160

    More redundsncy here?
  13. Josua Vogel uploaded patch set 7 V +1 03/02/26, 12:52

  14. Josua Vogel commented on patch set 7 03/02/26, 12:54

    FormatDateRenderableBeforeRendering.php:26 Reply

    Legacy error - I fixed it. The JS pattern was the stricter one.

    FormatDateRenderableBeforeRendering.php:32 Reply

    For now, I have only standardized the PHP part. I would tackle the JS part in the following PR, because I would have to rebuild it at this point anyway.

    DateRangeValidator.php:160 Reply

    For now, I have only standardized the PHP part. I would tackle the JS part in the following PR, because I would have to rebuild it at this point anyway.
  15. Josua Vogel uploaded patch set 8 03/02/26, 12:59

  16. core-ci voted on patch set 7 V +1 03/02/26, 13:01 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/97103

  17. core-ci voted on patch set 8 V +1 03/02/26, 13:37 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/97105

  18. Garvin Hicking commented on patch set 8 CR +1 V +1 03/02/26, 13:39

    Note: Currently the input date validator only shows "A date in format Y-m-d (...)" and misses the "or relative date" addition. The place for this is currently to small so the placeholder would not be shown. I can see that this will be addressed in the follow-up feature that revamps the GUI. I am voting under the assumption that we'll get the follow-up feature in as well. I think merging both patches would raise the complexity unneededly.
  19. Josua Vogel rebased onto patch set 9 CR +1 V +1 03/02/26, 16:34

  20. Josua Vogel updated the commit message in patch set 10 03/02/26, 16:36

  21. core-ci voted on patch set 10 V +1 03/02/26, 16:50 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/97128

  22. core-ci voted on patch set 9 V +1 03/02/26, 17:09 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/97126

  23. Garvin Hicking voted on patch set 10 CR +1 V +1 03/02/26, 20:16

  24. Georg Ringer voted on patch set 10 CR +2 V +2 03/02/26, 20:31

  25. Georg Ringer merged patch set 11 03/02/26, 20:31