fix: parseDate stop the js Date behavior that maps 2 digit years to 1900 - 1999
This is the fix of the issue https://github.com/iamkun/dayjs/issues/1237
To achieve this, I just call the setFullYear method of the Date object to force the date object to have the exact year.
plus after reading the tests code, I've understood that one of the goals of the parseDate method is to align with momentjs, so in my opinion this fix would reinforce the alignment.
Codecov Report
Merging #1862 (81692ea) into dev (8757477) will not change coverage. The diff coverage is
100.00%.
@@ Coverage Diff @@
## dev #1862 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 181 181
Lines 2064 2067 +3
Branches 537 534 -3
=========================================
+ Hits 2064 2067 +3
| Impacted Files | Coverage Δ | |
|---|---|---|
| src/index.js | 100.00% <100.00%> (ø) |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact),ø = not affected,? = missing dataPowered by Codecov. Last update 8757477...81692ea. Read the comment docs.
This PR solves issue #596 too.
This PR solves issue #596 too.
@iamkun yo it's been a while since this PR has been created, would you plz take a look and maybe potentially include it in a future release?
Any updates on this?
@iamkun 哥们儿,看看咱这个PR呗 ;) @iamkun yo man, plz check this out ;)