iamkun / iamkun/dayjs

`dayjs('0099-11-11').get('year')` get '1999' instead of '99'

Open
#2,550 0 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

**Describe the bug**
The year is `1999`

**Expected behavior**
The year is `99`.

Although we may not handle years less than 4 digits, this could be useful for historical dates.

**Information**
- Day.js Version [e.g. v1.0.0]
1.11.10
- OS: [e.g. iOS]
macOS
- Browser [e.g. chrome 62]
Chrome 119
- Time zone: [e.g. GMT-07:00 DST (Pacific Daylight Time)]
GMT+9:00 (Japan Standard Time)

Contributor guide

Open the contributing guide

Research direction

The issue names no files, tests, or entry points. Start by reproducing dayjs('0099-11-11').get('year') with Day.js 1.11.10, then trace the date parsing and year retrieval paths. Done means the value is 99 for this input while existing date behavior remains intact.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.