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

format() returns wrong result when timezone is applied #32

Closed
fabriziofortino opened this issue Sep 9, 2013 · 3 comments
Closed

format() returns wrong result when timezone is applied #32

fabriziofortino opened this issue Sep 9, 2013 · 3 comments
Labels

Comments

@fabriziofortino
Copy link

Please take a look at the following code:

moment(1369627200000).format('wo [week] YYYY')
"22nd week 2013"

It looks correct. Applying a different timezone I get a wrong result:

moment(1369627200000).tz('America/New_York').format('wo [week] YYYY')
"27th week 2013"
@mattjohnsonpint
Copy link
Contributor

This appears to be a valid bug, but it is only happening with the localized week of year formatters (w, wo, ww).

It appears to be working properly with the ISO week of year formatters (W, Wo, WW).

@fabriziofortino
Copy link
Author

@mj1856 in some case even using ISO week year formatter the result is wrong.

moment(1375070400000).format('Wo [week] YYYY')
"31st week 2013" // correct
moment(1375070400000).tz('America/New_York').format('Wo [week] YYYY')
"35th week 2013" // wrong

Any idea?

@timrwood
Copy link
Member

These should be working as expected in 0.1.0.

moment(1369627200000).format('wo [week] YYYY')
// 22nd week 2013
moment(1369627200000).tz('America/New_York').format('wo [week] YYYY')
// 22nd week 2013

moment(1375070400000).format('Wo [week] YYYY')
// 30th week 2013
moment(1375070400000).tz('America/New_York').format('Wo [week] YYYY')
// 31st week 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants