Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Datepicker: Support parsing, formatting, and selecting four-digit years before year 100 #1908

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

wartmanm
Copy link

These changes should resolve https://bugs.jqueryui.com/ticket/7098, as well as improving formatting for years before 1000.

4-digit years, unix times, and windows times now handle years between 0 and
99.  Additionally, negative unix times can be parsed.
@jsf-clabot
Copy link

jsf-clabot commented Jan 22, 2020

CLA assistant check
All committers have signed the CLA.

_formatYear: function( year ) {
var yearString = "" + year;
return year < 0 ? yearString :
yearString.length < 4 ? ( "0000" + yearString ).slice( -4 ) : yearString;
Copy link
Author

Choose a reason for hiding this comment

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

I'm honestly not sure how negative dates should be formatted.

Base automatically changed from master to main February 19, 2021 19:58
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.

None yet

3 participants