iamkun / iamkun/dayjs

Incorrect Day of Year

Open
#1,485 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 `dayOfYear()` when called for the last day i.e. 31st Dec, of a leap year returns `365` as output.

**Expected behavior**
The `dayOfYear()` when called for last day of a leap year should return `366` as output.

**Information**
- Day.js Version: v1.10.4
- OS: macOS
- Browser: N/A
- Time zone: UTC+05:30 IST (Indian Standard Time)]

![image](https://user-images.githubusercontent.com/29383381/116896240-aa095980-ac51-11eb-9ed4-2c139db17443.png)

Contributor guide

Open the contributing guide

Research direction

Start by locating the dayOfYear() implementation and reproduce the reported case for 31 December in a leap year. The issue is done when that case returns 366 while the existing day-of-year behavior remains correct.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
tooling
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.