UI Fix: Date time input 'year' field unmodifiable#63885
UI Fix: Date time input 'year' field unmodifiable#63885bbovenzi merged 4 commits intoapache:mainfrom
Conversation
|
Tests are failing |
bbovenzi
left a comment
There was a problem hiding this comment.
Yes this works. But the date is still the local timezone not UTC
|
And yes e2e tests need to be checked |
|
Spent some time trying to handle dayjs(date) and also dayjs.format(date) parsing year 00xx as 19xx |
pierrejeambrun
left a comment
There was a problem hiding this comment.
Working as expected, thanks
A couple small suggestions.
|
Thanks for the feedback! |
|
Merging. CI failure is unrelated |
* avoid passing parsed input back to component * on change, update component and debounce utc parsing * typo, linting fixes * longer type delay, removed redundant isValid check (cherry picked from commit f8c9c51) Co-authored-by: Tomi <74303735+Tomi-1997@users.noreply.github.com>
Backport successfully created: v3-1-testNote: As of Merging PRs targeted for Airflow 3.X In matter of doubt please ask in #release-management Slack channel.
|
* avoid passing parsed input back to component * on change, update component and debounce utc parsing * typo, linting fixes * longer type delay, removed redundant isValid check
* avoid passing parsed input back to component * on change, update component and debounce utc parsing * typo, linting fixes * longer type delay, removed redundant isValid check
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