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

moment('2018/12/31').format('YYYY-W') return '2018-1' ? Why not return '2019-1' ? #4855

Closed
wzx365 opened this issue Nov 9, 2018 · 2 comments

Comments

@wzx365
Copy link

wzx365 commented Nov 9, 2018

Chrome 68 on Windows 7

moment returns a wrong result when compute week, below is example. Should you fix it ?

moment('2018/12/31').format('YYYY-W') === '2018-1'
moment('2019/12/31').format('YYYY-W') === '2019-1'
@MynockSpit
Copy link

YYYY is the year of the date. Try gggg instead (the year of the week).

@wzx365
Copy link
Author

wzx365 commented Nov 11, 2018

Well, gggg is right. Thank you very much!

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

3 participants