Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

z timezone formatting option doesn't formatting as expected #2798

Open
MR-TechSavager opened this issue Dec 27, 2024 · 0 comments
Open

z timezone formatting option doesn't formatting as expected #2798

MR-TechSavager opened this issue Dec 27, 2024 · 0 comments

Comments

@MR-TechSavager
Copy link

Describe the bug
while trying to format a value using z it returns zone offset instead of abbreviated offset

const date = dayjs.tz('2024-12-22T16:21:11+05:30', 'Asia/Kolkata');
console.log(date.format('z')); // Expected: IST
console.log(date.format('Z')); // Expected: +05:30

instead of the above expected OP for z formatting it returns GMT:+5:30

I have tried using advancedFormat plugin too still im facing the issue

Expected behavior

z will be transformed abbreviated offset name correctly according to [(https://day.js.org/docs/en/plugin/advanced-format)]

Information

  • Day.js Version [1.11.13]
  • OS: [Ubuntu 24.04.1 LTS]
  • Browser [all browser]
  • Time zone: [ GMT+05:30 IST (Indian Standard Time)]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant