iamkun / iamkun/dayjs

关于闰年的 2月29日 年份加减问题?应当是多少?

Open
#2,603 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
48.7k
Forks
2.5k
PR merge metrics
No merged PRs in 30d

Description

例如 2024年2月29日 加1年,dayjs 计算结果为 2025年2月28日,而 Excel 中计算结果为 2025年3月1日。
![dayjs_add](https://github.com/iamkun/dayjs/assets/88811564/f17c99a3-d3a8-4f21-bf8d-3bf854a056cf)
![excel_add](https://github.com/iamkun/dayjs/assets/88811564/d9e8d3b0-728e-4b40-991a-32ad6d53eab1)

Contributor guide

Open the contributing guide

Research direction

Reproduce adding one year to 2024-02-29 in Day.js and compare the result with Excel as described in the issue. Review the existing year-add behavior and tests, then establish which result is expected before adding coverage for the chosen leap-year semantics.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.