iamkun / iamkun/dayjs

dayjs(timestamp).startOf('day') wrong result when timestamp < 1000000000

Open
#2,677 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 timestamp < 1000000000,
startOf('day') output wrong

**Expected behavior**
dayjs(999999999)
result : g3 {$L: 'en', $u: undefined, $d: Sun Sep 09 2001 09:46:39 GMT+0800 (中国标准时间), $x: {…}, $y: 2001, …}

dayjs(999999999).startOf('day')
result g3 {$L: 'en', $u: undefined, $d: Thu Aug 16 33657 00:00:00 GMT+0800 (中国标准时间), $x: {…}, $y: 33657, …}

Contributor guide

Open the contributing guide

Research direction

Start by tracing the dayjs(timestamp).startOf('day') entry point with the reported value 999999999. Compare the resulting date with the expected September 9, 2001 day boundary, and consider the issue complete when startOf('day') returns the correct start date for timestamps below 1000000000.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
web-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 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.