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

Option to display time zone in .format() not working #1141

Closed
JorgeSivil opened this issue Oct 15, 2020 · 2 comments
Closed

Option to display time zone in .format() not working #1141

JorgeSivil opened this issue Oct 15, 2020 · 2 comments

Comments

@JorgeSivil
Copy link

JorgeSivil commented Oct 15, 2020

Describe the bug

import dayjs from 'dayjs';
import dayjsUtc from 'dayjs/plugin/utc';
import dayjsTimezone from 'dayjs/plugin/timezone';
import dayjsAdvancedFormat from 'dayjs/plugin/advancedFormat';
dayjs.extend(dayjsUtc);
dayjs.extend(dayjsTimezone);
dayjs.extend(dayjsAdvancedFormat);

dayjs(unixTimestamp).tz('America/Los_Angeles').format(`z`) // results in z being outputted instead of the short timezone name.

The other advanced format options do work (at least the ones not requiring a plugin)

Expected behavior
Should be able to display timezone short name / long name

Information

  • Day.js Version "dayjs": "^1.9.3", plugin-utc": "^0.1.2",
  • OS: Linux
  • Browser Firefox 82
  • Time zone: [e.g. GMT-07:00 PDT (Pacific Daylight Time)]
@JorgeSivil JorgeSivil changed the title No option to display time zone in .format() ? Option to display time zone in .format() not working Oct 15, 2020
@JorgeSivil JorgeSivil reopened this Oct 15, 2020
@JorgeSivil
Copy link
Author

Fuck I'm so tired of being wrong

@mrkrlli
Copy link

mrkrlli commented Oct 21, 2020

Newest version of dayjs will have the z formatting option (added in 1.9.0): #1069

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

2 participants