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

fix: add support for year before 100 #548

Closed
wants to merge 1 commit into from
Closed

Conversation

dmitriytat
Copy link

This PR brings ability to use years between 0 and 99 while parse date string

@iamkun
Copy link
Owner

iamkun commented Mar 28, 2019

Thanks to this fix. Just not sure if there a real use case or not for the year before 100?

@dmitriytat
Copy link
Author

I In my case it was validation of birthdate in text input. Date restrictions were from 1900 to now - 13 years. But if user selects 0010-04-05, it will be converted to 1910-04-05 and input pass validation.

@ghost
Copy link

ghost commented Mar 28, 2019

0010-04-05 is a strange date string either. Can we just update the date picker to get the correct date string?

@codecov-io
Copy link

codecov-io commented Mar 28, 2019

Codecov Report

Merging #548 into dev will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@         Coverage Diff         @@
##            dev   #548   +/-   ##
===================================
  Coverage   100%   100%           
===================================
  Files       151    151           
  Lines       942    944    +2     
  Branches    123    123           
===================================
+ Hits        942    944    +2
Impacted Files Coverage Δ
src/index.js 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 71e4bff...dcecc80. Read the comment docs.

@dmitriytat
Copy link
Author

I agree, it’s weird, but it’s format of default html input type=date. And yes, we can use min and max with this type, if it is supported.

I think it’s strange that I can't use dayjs just like I used to use moment or vanilla new Date(‘0010-04-04’).

@iamkun
Copy link
Owner

iamkun commented Mar 28, 2019

Yes, it's a small bug with Day.js of parsing 0010-04-04 format. But such date string is too wired that we could just ignore this.

Until we could find some other need for parsing this kind of string, I'm afraid I may not want to merge this.

@iamkun
Copy link
Owner

iamkun commented Apr 26, 2019

I'll close this pr since it's been a while since it's been opened. Feel free to reopen if you have updates on this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants