92996[FEATURE] Add DateEditor web component for ext:form
Commit message
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 18
- Build/Sources/TypeScript/form/backend/form-editor/component/date-editor.tsnew+265 −0
- Build/Sources/TypeScript/form/backend/form-editor/inspector-component.ts+99 −0
- Build/Sources/TypeScript/form/backend/form-editor/view-model.ts+8 −10
- Build/types/TYPO3/index.d.ts+3 −0
- typo3/sysext/core/Documentation/Changelog/14.2/Feature-109126-DateEditorForFormFramework.rstnew+46 −0
- typo3/sysext/form/Classes/Controller/FormEditorController.php+4 −0
- typo3/sysext/form/Classes/EventListener/FormatDateRenderableBeforeRendering.php+1 −9
- typo3/sysext/form/Classes/Mvc/Validation/DateRangeValidator.php+37 −36
- typo3/sysext/form/Classes/Utility/DateRangeValidatorPatterns.php+35 −8
- typo3/sysext/form/Configuration/Yaml/FormElements/Date.yaml+3 −6
- typo3/sysext/form/Configuration/Yaml/FormSetup.yaml+1 −0
- typo3/sysext/form/Resources/Private/Backend/Partials/FormEditor/Inspector/DateEditor.fluid.html2new+14 −0
- typo3/sysext/form/Resources/Private/Language/locallang.xlf+3 −0
- typo3/sysext/form/Resources/Private/Language/locallang_relative_date_editor.xlf5new+44 −0
- typo3/sysext/form/Resources/Public/JavaScript/backend/form-editor/component/date-editor.jsnew+13 −0
- typo3/sysext/form/Resources/Public/JavaScript/backend/form-editor/inspector-component.js+1 −1
- typo3/sysext/form/Resources/Public/JavaScript/backend/form-editor/view-model.js+1 −1
- typo3/sysext/form/Tests/Functional/Mvc/Validation/DateRangeValidatorTest.php+49 −72
Review log 4360
Show 2535 earlier messages
-
Josua Vogel uploaded patch set 1 02/25/26, 15:01
-
Josua Vogel updated the commit message in patch set 2 02/25/26, 15:03
-
Josua Vogel uploaded patch set 3 02/25/26, 15:13
-
core-ci voted on patch set 3 V -1 02/25/26, 15:25 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/96833
-
core-ci voted on patch set 1 V -1 02/25/26, 15:41 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/96830
-
core-ci voted on patch set 2 V -1 02/25/26, 15:47 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/96832
-
Josua Vogel rebased onto patch set 4
V -103/02/26, 13:42 -
core-ci voted on patch set 4 V -1 03/02/26, 14:19 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/97111
-
Josua Vogel uploaded patch set 5
V -103/02/26, 16:34 -
core-ci voted on patch set 5 V -1 03/02/26, 17:12 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/97127
-
Josua Vogel uploaded patch set 6
V -103/03/26, 06:07 -
core-ci voted on patch set 6 V -1 03/03/26, 06:16 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/97153
-
Josua Vogel uploaded patch set 7
V -103/03/26, 08:41 -
core-ci voted on patch set 7 V +1 03/03/26, 08:55 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/97160
-
Simon Schaufelberger commented on patch set 7 03/03/26, 09:02
-
Josua Vogel uploaded patch set 8
V +103/03/26, 09:06 -
Josua Vogel commented on patch set 8 03/03/26, 09:06
DateEditor.fluid.html:1ReplyDone -
core-ci voted on patch set 8 V +1 03/03/26, 09:16 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/97164
-
Garvin Hicking commented on patch set 8 V +1 03/04/26, 08:21
locallang_relative_date_editor.xlf:19This wraps unfortunately for me to "in the f..." and "in the p..." I wonder if we should just use "past" and "future" here? I really like the dense display otherwise. Another way would be to change the top level dropdown to: - No value - Today - Absolute day - Relative date in the future - Relative date in the past I reckon that would be a huge structural change though. So shortening the label is maybe better....wdyt? -
Josua Vogel commented on patch set 8 03/04/26, 08:25
locallang_relative_date_editor.xlf:19ReplyI´m fine with shorter label. Thought about + and -, but I think, that´s not user friendly :) -
Josua Vogel uploaded patch set 9
V +103/04/26, 08:29 -
Josua Vogel commented on patch set 9 03/04/26, 08:29
locallang_relative_date_editor.xlf:19ReplyDone -
Garvin Hicking voted on patch set 9 CR +1 V +1 03/04/26, 08:43
-
core-ci voted on patch set 9 V +1 03/04/26, 08:44 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/97270
-
Georg Ringer commented on patch set 9 V -1 03/04/26, 08:44
I am not sure if we should split that up in week/month, something like "1 week 6 days" is not possible then anymore and yes this can be really handy. I would keep the input field -
Anja Leichsenring voted on patch set 9 CR +1 V +1 03/04/26, 08:52
-
Josua Vogel commented on patch set 9 03/04/26, 08:56
Reply
Good point – I thought about this as well. However, I'm not sure if "1 week and 6 days" is really a practical use case for relative dates. At that point, wouldn't a fixed/absolute date be more appropriate? Additionally, the user could simply enter "13 days" instead, which achieves the same result. IMO the input field is not user friendly - I know many editors who don´t know the php wordings. -
Anja Leichsenring commented on patch set 9 03/04/26, 08:57
Reply
maybe add another option "manual input" that brings the input field back? While I would argue that some little math solves that problem easily enough: 13 days in the future, is it not? -
Sven Liebert voted on patch set 9 CR +1 V +1 03/04/26, 09:07
-
Josua Vogel uploaded patch set 10
CR +1V +103/04/26, 09:11 -
Josua Vogel commented on patch set 10 03/04/26, 09:12
Resolved merge conflict -
Sven Liebert voted on patch set 10 CR +1 V +1 03/04/26, 09:17
-
core-ci voted on patch set 10 V +1 03/04/26, 09:27 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/97282
-
Anja Leichsenring commented on patch set 10 V -1 03/04/26, 09:50
repeating Georgs sentiment. Please lets discuss this first. -
Garvin Hicking commented on patch set 10 03/04/26, 12:58
Reply
This breaks apart for "1 months and 3 days". Because then you can't math it. I think adjusting the dropdown to contain a "manual relative date" would solve this, and hopefully not be too complex.
-
Josua Vogel commented on patch set 10 03/04/26, 13:12
Reply
I'm not fundamentally opposed to it, but is it perhaps too far-fetched/overengineered? I simply can't think of any use case where you would need to set such a relative value. Every use case I can think of in this regard has to do with an absolute date. Is there really anything where you need a maximum/minimum in 1 month and three days every day? Theoretically, a developer could also create a custom editor for this use case or simply integrate the text editor again. -
Garvin Hicking commented on patch set 10 03/04/26, 13:54
Reply
What about "last Monday" or "next Sunday" then, would that sound like a more plausible use case? :) -
Josua Vogel commented on patch set 10 03/04/26, 14:11
Reply
Fair point 😄 -
Josua Vogel uploaded patch set 11
CR +1V +103/04/26, 14:30 -
Josua Vogel commented on patch set 11 03/04/26, 14:30
Reply
Done -
core-ci voted on patch set 11 V +1 03/04/26, 14:40 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/97332
-
Garvin Hicking commented on patch set 11 03/04/26, 15:42
Reply
The validation currently does not allow me to enter "last sunday" and "first sunday next month" as relative dates, probably because it's locked by the "+1" and day/month/year usage. Also I'm recognizing now that `DateRangeValidatorPatterns` and its regexp might be too strict. Couldn't we have "relative date" then defined as "anything that does not match RFC3339_FULL_DATE? Then we could check for strtotime === false if anything has been entered that does not match. Handling it clientside for JavaScript maybe we can switch to not displaying an error like "Invalid relative date expression" but instead something like "This may not be a valid relative date expression, please verify your input works" if the regexp is not satisfied. But then not block entering them?locallang_relative_date_editor.xlf:40```suggestion <source>e.g. "sunday next month"</source> ``` -
Josua Vogel commented on patch set 12
V +103/04/26, 15:45Published edit on patch set 11. -
Josua Vogel commented on patch set 12 03/04/26, 15:49
locallang_relative_date_editor.xlf:40ReplyFix applied. -
core-ci voted on patch set 12 V +1 03/04/26, 16:26 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/97341
-
Josua Vogel uploaded patch set 13
V +103/04/26, 16:58 -
core-ci voted on patch set 13 V -1 03/04/26, 17:15 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/97348
-
Josua Vogel uploaded patch set 14
V -103/05/26, 06:24 -
Josua Vogel commented on patch set 14 03/05/26, 06:29
Reply
please try again 😊 -
core-ci voted on patch set 14 V +1 03/05/26, 06:32 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/97386
-
Josua Vogel commented on patch set 15
V +103/05/26, 07:40Published edit on patch set 14. -
core-ci voted on patch set 15 V +1 03/05/26, 07:49 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/97389
-
Garvin Hicking commented on patch set 15 03/05/26, 09:48
Reply
This is pretty nice for me now, we're getting close. One thing: If I enter an invalid expression like "your mom" into a date max/min element it is passed on to the HTML `<input>` element. This is then silently ignored, that's fine. However, if I submit this I get: ``` (1/1) #1521293814 TYPO3\CMS\Form\Mvc\Validation\Exception\InvalidValidationOptionsException The option "maximum" (hörker pörk!) could not be converted to DateTime. Use format "Y-m-d" or a relative expression (e.g. "today", "-18 years"). ``` now I wonder if this exception should be end-user facing. Two ideas: Either could we somehow "simulate" in the EXT:form GUI to perform a PHP strtotime() conversion here and report errors in the GUI of the backend? Probably hard to execute PHP in there (we'd have to setup an ajax route?!) The other idea: Instead of exceptioning there, we create a better abstragt validation error for the field like "Technical implementation error, the field could not be validated. This error has been logged". And then, we would also need to log this error instead of throwing. wdyt? -
Josua Vogel commented on patch set 15 03/05/26, 10:33
Reply
I like the second idea. It solves the problem and does not require a complex change, such as an Ajax route. -
Josua Vogel uploaded patch set 16
V +103/05/26, 10:45 -
core-ci voted on patch set 16 V -1 03/05/26, 10:58 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/97403
-
core-ci voted on patch set 16 V +1 03/05/26, 12:17 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/97403
-
Garvin Hicking commented on patch set 16 CR +1 V +1 03/05/26, 12:37
Reply
I'm good with that. Thanks! 😊 -
Georg Ringer voted on patch set 16 CR +2 V +2 03/05/26, 13:09
-
Georg Ringer merged patch set 17 03/05/26, 13:09
DateEditor.fluid.html:1