iamkun / iamkun/dayjs

`advancedFormat`'s `z` outputs offset instead of abbreviated offset name for Central European Standard Time

Open
#1,713 9 comments 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
48.7k
Forks
2.8k
PR merge metrics
No merged PRs in 30d

Description

Describe the bug
Using the advanced formatting for the abbreviated timezone outputs the offset instead of the abbreviation of the name:
GMT+1 instead of CEST for Europe/Berlin

Please see the behavior in this stackblitz

Expected behavior

From the docs and the EST example (see screenshot), I'd expect
dayjs().tz('Europe/Berlin').format('hh:mmA z');
to output e.g.
11:07AM CEST instead of 11:07AM GMT+1

image

Central European Time on wikipedia

Information

  • Day.js Version [1.10.7]
  • OS: [Windows]
  • Browser [Version 96.0.4664.45 (Official Build) (64-bit)]
  • Time zone: [e.g. GMT+1 CEST (Central European Summer Time)]

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the advancedFormat z behavior from the linked StackBlitz with dayjs().tz('Europe/Berlin').format('hh:mmA z'); compare the result with the advanced-format documentation and timezone context in the issue. Done means the Berlin example returns an abbreviated timezone name such as CEST rather than GMT+1.

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
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.