dayjs icon indicating copy to clipboard operation
dayjs copied to clipboard

fix: parseDate stop the js Date behavior that maps 2 digit years to 1900 - 1999

Open shye0000 opened this issue 3 years ago • 7 comments

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.

shye0000 avatar Apr 19 '22 20:04 shye0000

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 data Powered by Codecov. Last update 8757477...81692ea. Read the comment docs.

codecov[bot] avatar Apr 19 '22 20:04 codecov[bot]

This PR solves issue #596 too.

BePo65 avatar Jun 02 '22 15:06 BePo65

This PR solves issue #596 too.

BePo65 avatar Jun 02 '22 15:06 BePo65

@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?

shye0000 avatar Jun 05 '22 19:06 shye0000

Any updates on this?

timmd909 avatar Jun 08 '23 18:06 timmd909

@iamkun 哥们儿,看看咱这个PR呗 ;) @iamkun yo man, plz check this out ;)

shye0000 avatar Jun 08 '23 21:06 shye0000