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

Plugin weekOfYear doesn't work well for locale zh-cn #664

Closed
DevinXian opened this issue Aug 23, 2019 · 2 comments
Closed

Plugin weekOfYear doesn't work well for locale zh-cn #664

DevinXian opened this issue Aug 23, 2019 · 2 comments

Comments

@DevinXian
Copy link

Issue code demo

const dayjs = require('dayjs')
const moment = require( 'moment')
require( 'dayjs/locale/zh-cn')
const weekOfYear = require('dayjs/plugin/weekOfYear')

moment.locale('zh-cn')

dayjs.locale('zh-cn')
dayjs.extend(weekOfYear)

console.log(dayjs('2019-08-18').week()) // 34
console.log(moment('2019-08-18').week()) // 33

Expected behavior

Both should be 33

Information

  • Day.js Version [v1.8.15]
  • Moment Version [v2.24.0]
  • OS: [Mac OS X 10.14.4]
  • Time zone: [GMT+08:00(China Standard Time)]
@PengJiyuan
Copy link

+1

@iamkun
Copy link
Owner

iamkun commented Aug 26, 2019

fixed in #658

@iamkun iamkun closed this as completed Aug 26, 2019
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