Skip to content

Fix year 100 - 999#2396

Open
MoonE wants to merge 3 commits intojquery:mainfrom
MoonE:fix-year-100-999
Open

Fix year 100 - 999#2396
MoonE wants to merge 3 commits intojquery:mainfrom
MoonE:fix-year-100-999

Conversation

@MoonE
Copy link
Copy Markdown

@MoonE MoonE commented Mar 14, 2026

This fixes part of #2388

Copy link
Copy Markdown
Member

@mgol mgol left a comment

Choose a reason for hiding this comment

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

Can you explain precisely what it fixes and what it does not?

@MoonE
Copy link
Copy Markdown
Author

MoonE commented Apr 22, 2026

Sorry for the delay, I seem to have missed your comment.

With yy format it expects exactly four digits for the year when parsing.

size = ( match === "@" ? 14 : ( match === "!" ? 20 :
( match === "y" && isDoubled ? 4 : ( match === "o" ? 3 : 2 ) ) ) ),
minSize = ( match === "y" ? size : 1 ),
digits = new RegExp( "^\\d{" + minSize + "," + size + "}" ),

Without this change selecting a date with year in range 100-999 works but is formatted as 999-01-01 which cannot be parsed when the datepicker is opened again.

Currently datepicker only works correctly for years 1000-9999.
This makes it work for years 0100-9999,
#2391 would make it work for years 0000-9999

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

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants