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

isoWeek() returns wrong value in utc mode #991

Closed
AoDev opened this issue Aug 7, 2020 · 2 comments · Fixed by #993
Closed

isoWeek() returns wrong value in utc mode #991

AoDev opened this issue Aug 7, 2020 · 2 comments · Fixed by #993
Labels

Comments

@AoDev
Copy link

AoDev commented Aug 7, 2020

Describe the bug
isoWeek() should return a number between 1 and 53 but it seems to have problems in utc mode.

import dayjs from 'dayjs'
import isoWeek from 'dayjs/plugin/isoWeek.js'
import utc from 'dayjs/plugin/utc.js'

dayjs.extend(isoWeek)
dayjs.extend(utc)

// 1577836800000 is timestamp for Wednesday, 1 January 2020 00:00:00 UTC

console.log(dayjs(1577836800000).isoWeek()) // -> 1
console.log(dayjs.utc(1577836800000).isoWeek()) // -> 3600001

Expected behavior

I would expect 1 in that case.

Information

  • Day.js Version 1.8.32
  • OS: OSX Mojave
  • Nodejs 12.16.1
  • Time zone: UTC + 2
@iamkun
Copy link
Owner

iamkun commented Aug 7, 2020

thanks, it's a bug

@iamkun
Copy link
Owner

iamkun commented Aug 10, 2020

🎉 This issue has been resolved in version 1.8.33 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging a pull request may close this issue.

2 participants