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

Named offset not working as documented #1077

Closed
nirmalkarmani opened this issue Sep 25, 2020 · 4 comments
Closed

Named offset not working as documented #1077

nirmalkarmani opened this issue Sep 25, 2020 · 4 comments

Comments

@nirmalkarmani
Copy link

nirmalkarmani commented Sep 25, 2020

Based on the advanced format documentation, using z and zzz should give named offsets (abbreviated and non-abbreviated)

https://day.js.org/docs/en/plugin/advanced-format

However, when trying to use z and zzz it doesn't work as specified.

My code (NodeJS with TypeScript)

import dayjs from 'dayjs';
import utc from "dayjs/plugin/utc";
import timezone from 'dayjs/plugin/timezone';
import advancedFormat from 'dayjs/plugin/advancedFormat';

dayjs.extend(utc)
dayjs.extend(advancedFormat)
dayjs.extend(timezone)

var out = dayjs().tz('America/Panama');
console.log(out.format('ddd, DD MMM YYYY HH:mm:ss Z z (zzz)'));

Expected Output
Fri, 25 Sep 2020 04:47:06 -05:00 EST (Eastern Standard Time)

Actual Output
Fri, 25 Sep 2020 04:47:06 -05:00 z (zzz)

Node Version : v12.17.0
NPM Version : 6.14.4
dayjs Version: 1.8.36

@iamkun
Copy link
Owner

iamkun commented Sep 25, 2020

I'm sorry for the inconvenience, this feature has just been implanted and not released yet.

Will be available in the next release soon.

@nirmalkarmani
Copy link
Author

Noted, thanks for the prompt response.

Any ETA on the next release?

Additionally, should I proceed to close this issue? This is the 1st time I have ever reported one and I am not too sure how does one go about after submitting an issue

@iamkun
Copy link
Owner

iamkun commented Sep 28, 2020

This feature is released in 1.9.0.

@nirmalkarmani
Copy link
Author

Hey @iamkun thanks for releasing the update. I have tested v1.9.0 and can confirm it works as expected

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