weekdaysShort only return the first day
See original GitHub issueHi there, I facing a strange bug of dayjs locale
that I can’t reproduce on fiddle 😢
It only occur on my projects, this isn’t the first time I used dayjs
, but this is the first time I facing this problem.
I know I should create reproduce steps but I can’t because my projects is too large and I trying to replace moment
by dayjs
so it have a lot of changes 😢
https://github.com/iamkun/dayjs/blob/8cf4d2d608b3cf99863b3ae77467dc8b9d83e729/src/index.js#L284
Sometime, the locale.weekdaysShort
(line above) return only the first item of the full list, so it will result in a error on line below because arr[index]
will be undefined
:
https://github.com/iamkun/dayjs/blob/8cf4d2d608b3cf99863b3ae77467dc8b9d83e729/src/index.js#L262
I debugging a half of day but I can’t find out why it occur, below is image that I captured when debugging directly on dayjs.min.js
built file, please see it for more information because It really hard to describe by comment 😢
A strange point is the error doesn’t occur on default locale (en), It only occur when I use other locales (tested zh and vi locale).
Please see debug images below for more information because it really hard to be describe by comment.


Thank you so much for a great library ever.
Expected behavior
The error t is not a function
shouldn’t fired
Information
- Day.js Version 1.8.36
- OS: MacOs
- Browser: chrome 85
- Time zone: GMT+07:00
- Locale used for test: zh and vi
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (2 by maintainers)
I’m afraid I can not reproduce this on my computer. A demo repo provided will be better.
Cheers~