iamkun / iamkun/dayjs

GMT offset incorrectly reported by format method

Open
#1,413 0 comments 3 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**
GMT offset is incorrectly reported by the format method but appears to be correctly handled by the browser's `Date` object.

**Expected behavior**
See screenshot below. GMT offsets are reported as `-06:00` both before and after DST change on March 14th, 2021. However, the internal `Date` object reports the correct GMT offset.

![image](https://user-images.githubusercontent.com/12059563/110848475-c1d8e880-8273-11eb-8bde-68aaebb4c0a6.png)

**Information**
- Day.js Version: Latest from day.js.org today, tested on the browser's Dev Tools
- OS: Arch Linux
- Browser: Google Chrome Version 88.0.4324.150 (Official Build) (64-bit)
- Time zone: GMT-06:00 (Central Standard Time)

Contributor guide

Open the contributing guide

Research direction

No source file or test is named. Start by reproducing the Day.js format output in Chrome for the Central time zone immediately before and after the March 14, 2021 DST change, then compare it with the browser Date object's GMT offset. Done means the format method reports the correct offset across that transition.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
api
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 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.