dayjs: Chrome v88 (88.0.4324.93) for Android does not recognize date
Device: Android phone (with Android v10) Browser: Chrome v88 (88.0.4324.93).
dayJs(‘2021-01-26T00:00:00Z’).tz(tz) returns “Invalid Date”. Started happening with Chrome upgrade v88.
dayJs(dateWithFormat).tz(tz)
--> Works everywhere except Chrome88 on Android 10
dayJs.tz(dateWithFormat, tz)
--> Works on Chrome 88 for Android 10.
Shouldn’t these methods return the same values irrespective of the browser or the underlying OS?
About this issue
- Original URL
- State: open
- Created 3 years ago
- Reactions: 8
- Comments: 22 (1 by maintainers)
I wrote this polyfill to fix this issue. It is really ugly, but it should work.
Notice: This code is only usable if you do not use “toLocaleString” anywhere, except dayjs. It just fix dayjs, but can break other code (if it use toLocaleString method).
Looks like chrome started to ignore locale in arguments ECMA-402