iamkun / iamkun/dayjs

ISO8601 dates with timezones not parsed properly in Safari

Open
#917 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 instantiating a new dayjs object with `dayjs()` from an ISO8601 date with explicit timezone, on calling format 'Invalid Date' is returned. This was tested as working in both FF and Chromium before being tested on Safari.

A sample code snip to reproduce is `dayjs("2020-05-25T11:53:47-0400").format("dddd, MMMM D, YYYY - HH:mm")`

**Expected behavior**
The date should be properly formatted and returned. The expected value for the example is `Monday, May 25, 2020 - 11:53`.

**Information**
- Day.js Version: 1.8.27
- OS: MacOS
- Browser: Safari 13.1
- Time zone: GMT-04:00 DST (Eastern Daylight Time)

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the dayjs("2020-05-25T11:53:47-0400").format(...) example in Safari 13.1 and compare its result with Firefox and Chromium. Done means the sample returns "Monday, May 25, 2020 - 11:53" instead of "Invalid Date".

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.