Skip to content

UI Fix: Date time input 'year' field unmodifiable#63885

Open
Tomi-1997 wants to merge 1 commit intoapache:mainfrom
Tomi-1997:ui-fix-dateinput-year-stuck
Open

UI Fix: Date time input 'year' field unmodifiable#63885
Tomi-1997 wants to merge 1 commit intoapache:mainfrom
Tomi-1997:ui-fix-dateinput-year-stuck

Conversation

@Tomi-1997
Copy link
Contributor

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

@boring-cyborg boring-cyborg bot added the area:UI Related to UI/UX. For Frontend Developers. label Mar 18, 2026
@bbovenzi bbovenzi added this to the Airflow 3.1.9 milestone Mar 18, 2026
@bbovenzi bbovenzi added the backport-to-v3-1-test Mark PR with this label to backport to v3-1-test branch label Mar 18, 2026
@eladkal
Copy link
Contributor

eladkal commented Mar 18, 2026

Tests are failing

Copy link
Contributor

@bbovenzi bbovenzi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes this works. But the date is still the local timezone not UTC

@bbovenzi
Copy link
Contributor

And yes e2e tests need to be checked

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:UI Related to UI/UX. For Frontend Developers. backport-to-v3-1-test Mark PR with this label to backport to v3-1-test branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants