UI Fix: Date time input 'year' field unmodifiable#63885
Open
Tomi-1997 wants to merge 1 commit intoapache:mainfrom
Open
UI Fix: Date time input 'year' field unmodifiable#63885Tomi-1997 wants to merge 1 commit intoapache:mainfrom
Tomi-1997 wants to merge 1 commit intoapache:mainfrom
Conversation
Contributor
|
Tests are failing |
bbovenzi
approved these changes
Mar 18, 2026
Contributor
bbovenzi
left a comment
There was a problem hiding this comment.
Yes this works. But the date is still the local timezone not UTC
Contributor
|
And yes e2e tests need to be checked |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #57880
Problem
When the date input is full, the year field can't be modified
Why
The value is converted to a dayjs object, which parses a year with 2 digits from 00xx (which occurs while typing) to 19xx
For example, dayjs(0002-03-17T15:33) = Mon, 17 Mar 1902 15:13:30
iamkun/dayjs#1237
before.mp4
Possible solution
Avoid passing back the parsed date value to the component
The displayed value will remain the same, but the actual value (which is 'watched' by other forms) will be in UTC
Possible problems with this approach:
When typing from 2026 to 2025, the actual value will be:
2026 -> 1902 -> 1920 -> 0202 -> 2025
But the year being displayed to the user will be:
2026 -> 0002 -> 0020 -> 0202 -> 2025
Lmk what you think, with the display discrepancy in mind