iamkun / iamkun/dayjs

Strange behaviour with dates between 1969 to 1971

Open
#2,817 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**
When using dates in the years 1969, 1970 and 1971, using operations like "startOf" results in times from other days
i.e. `dayjs('1970-01-07T01:00:00').startOf('day')` will result in "Tue, 06 Jan 1970 23:00:00 GMT". Years before and after these 3 years do not show the same problem

**Expected behavior**
`dayjs('1970-01-07T01:00:00').startOf('day')` should display "Weds, 07 Jan 1970 00:00:00 GMT"

**Information**
- Day.js Version: 1.11.0
- OS: iOS
- Browser: chrome 131.0.6778.265
- Time zone: GMT

Contributor guide

Open the contributing guide

Research direction

Reproduce the reported dayjs('1970-01-07T01:00:00').startOf('day') call in the GMT environment, then compare its result with dates before and after 1969–1971. Start at the startOf entry point and verify that these years produce the expected calendar day without regressing other years.

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
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.