iamkun / iamkun/dayjs

UTC object conversion

Open
#1,234 1 comment 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

This works perfectly fine - dayjs('2020-11-20T19:01:03.775Z').utc();
Why this would fail? - dayjs('2020/11/20T19:01:03.775Z').utc();

**Current Output**
dayjs coverts the valid date to an object with all values defined as NAN

**Expected Output**
dayjs should be able to convert the valid date to an object with all the values correctly populated

Contributor guide

Open the contributing guide

Research direction

Start with the two dayjs(...).utc() reproductions in the issue and trace the date-parsing entry point for the slash-and-T format. Add a regression test covering the reported input, then verify that the resulting object contains populated date values rather than NaN.

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.