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

dayjs().format('YYYY w Week') error result #676

Closed
LauRocky opened this issue Sep 17, 2019 · 5 comments · Fixed by BlueWallet/BlueWallet#862 · May be fixed by cds-snc/apply-for-a-grant#32
Closed

dayjs().format('YYYY w Week') error result #676

LauRocky opened this issue Sep 17, 2019 · 5 comments · Fixed by BlueWallet/BlueWallet#862 · May be fixed by cds-snc/apply-for-a-grant#32
Labels
☢️Bug Something isn't working released

Comments

@LauRocky
Copy link

Describe the bug
使用dayjs().format('YYYY年第w周') 期望可以得到 2019年第29周

Expected behavior
使用dayjs().format('YYYY年第w周') 期望可以得到 2019年第29周,实际上却展示为2019年第w周

Information

  • Day.js 版本1.8.16
  • OS: Linux
  • Browser chrome 74.0.3729.131
  • Time zone: GMT+08:00
@iamkun
Copy link
Owner

iamkun commented Sep 17, 2019

Bug confirmed.

Current workaround

var dayjs = require("dayjs")
var advancedFormat = require('dayjs/plugin/advancedFormat')
var weekOfYear = require('dayjs/plugin/weekOfYear')

dayjs.extend(advancedFormat)
dayjs.extend(weekOfYear)


dayjs().format('YYYY年第wo周')

@iamkun iamkun added the ☢️Bug Something isn't working label Sep 17, 2019
@iamkun iamkun changed the title dayjs().format('YYYY年第w周') 不能得到正确的格式化结果 dayjs().format('YYYY w Week') error result Sep 17, 2019
@sam019
Copy link

sam019 commented Sep 18, 2019

@iamkun hello, i also find dayjs().format('gggg')not working, but momentjs support it. expect dayjs support it

@iamkun
Copy link
Owner

iamkun commented Sep 18, 2019

@sam019

'gggg' is already supported in advancedFormat plugin (and depend on weekYear plugin)

dayjs.extend(weekYear)
dayjs.extend(advancedFormat)

dayjs().format('gggg')

@sam019
Copy link

sam019 commented Sep 18, 2019

@sam019

'gggg' is already supported in advancedFormat plugin (and depend on weekYear plugin)

dayjs.extend(weekYear)
dayjs.extend(advancedFormat)

dayjs().format('gggg')

ok thanks~

@iamkun iamkun closed this as completed in 26cfa63 Oct 9, 2019
iamkun pushed a commit that referenced this issue Nov 6, 2019
## [1.8.17](v1.8.16...v1.8.17) (2019-11-06)

### Bug Fixes

* Fix set utcOffset in utc mode ([d148115](d148115))
* Update advancedFormat plugin to support w ww wo week tokens … ([#678](#678)) ([26cfa63](26cfa63)), closes [#676](#676)
* Update ka locale weekdays ([f8ca3d4](f8ca3d4))
* Update nb locale ([#679](#679)) ([1063b0e](1063b0e))
* Update Polish locale (pl)([#713](#713)) ([30d2f02](30d2f02))
* Update Ukrainian locale (uk) ([#710](#710)) ([360161c](360161c))
* UTC plugin set utcOffset value ([#668](#668)) ([8877883](8877883))
@iamkun
Copy link
Owner

iamkun commented Nov 6, 2019

🎉 This issue has been resolved in version 1.8.17 🎉

The release is available on:

Your semantic-release bot 📦🚀

@iamkun iamkun added the released label Nov 6, 2019
andrewhood125ruhuc added a commit to andrewhood125ruhuc/SidRH2 that referenced this issue May 10, 2022
## [1.8.17](iamkun/dayjs@v1.8.16...v1.8.17) (2019-11-06)

### Bug Fixes

* Fix set utcOffset in utc mode ([d148115](iamkun/dayjs@d148115))
* Update advancedFormat plugin to support w ww wo week tokens … ([#678](iamkun/dayjs#678)) ([26cfa63](iamkun/dayjs@26cfa63)), closes [#676](iamkun/dayjs#676)
* Update ka locale weekdays ([f8ca3d4](iamkun/dayjs@f8ca3d4))
* Update nb locale ([#679](iamkun/dayjs#679)) ([1063b0e](iamkun/dayjs@1063b0e))
* Update Polish locale (pl)([#713](iamkun/dayjs#713)) ([30d2f02](iamkun/dayjs@30d2f02))
* Update Ukrainian locale (uk) ([#710](iamkun/dayjs#710)) ([360161c](iamkun/dayjs@360161c))
* UTC plugin set utcOffset value ([#668](iamkun/dayjs#668)) ([8877883](iamkun/dayjs@8877883))
andrewhood125ruhuc added a commit to andrewhood125ruhuc/SidRH2 that referenced this issue May 10, 2022
## [1.8.17](iamkun/dayjs@v1.8.16...v1.8.17) (2019-11-06)

### Bug Fixes

* Fix set utcOffset in utc mode ([d148115](iamkun/dayjs@d148115))
* Update advancedFormat plugin to support w ww wo week tokens … ([#678](iamkun/dayjs#678)) ([26cfa63](iamkun/dayjs@26cfa63)), closes [#676](iamkun/dayjs#676)
* Update ka locale weekdays ([f8ca3d4](iamkun/dayjs@f8ca3d4))
* Update nb locale ([#679](iamkun/dayjs#679)) ([1063b0e](iamkun/dayjs@1063b0e))
* Update Polish locale (pl)([#713](iamkun/dayjs#713)) ([30d2f02](iamkun/dayjs@30d2f02))
* Update Ukrainian locale (uk) ([#710](iamkun/dayjs#710)) ([360161c](iamkun/dayjs@360161c))
* UTC plugin set utcOffset value ([#668](iamkun/dayjs#668)) ([8877883](iamkun/dayjs@8877883))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
☢️Bug Something isn't working released
Projects
None yet
3 participants