iamkun / iamkun/dayjs

dayjs fromNow returns Invalid Date

Open
#2,368 3 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
dayjs(NaN).fromNow(false);

returns "a month ago"

Till release 1.11.8 it was always returning "NaN years ago"

Information

Day.js Version 1.11.9
Time zone: GMT+02:00 [MESZ]

Contributor guide

Open the contributing guide

Research direction

Reproduce the exact dayjs(NaN).fromNow(false) call and compare its result with Day.js 1.11.8 and 1.11.9. Start at the fromNow entry point; done means the invalid-input behavior is explicitly covered by a regression test and the returned value matches the intended behavior described in the issue.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.