toLocaleString call in timezone throws error "Invalid date" on IE11
- Dominant language
- JavaScript
- Stars
- 48.7k
- Forks
- 2.5k
- PR merge metrics
- No merged PRs in 30d
Description
I was trying ot use dayjs in IE11 with this polyfill https://www.npmjs.com/package/date-time-format-timezone and I got an error on this line:
https://github.com/iamkun/dayjs/blob/9c20e77caf7b1b5eccf418175203b198d4e29535/src/plugin/timezone/index.js#L98
trying it out in the browser console:

The polyfill it does seem to work fine-

Without the polyfill dayjs timezone can never work correctly.
Maybe it would be a good idea to add some spec or remove this

because this just creates false impression that you can use dayjs on IE without any issues.
Maybe with this polyfill: https://formatjs.io/docs/polyfills/intl-datetimeformat
It would work better, but it doesn bundle correctly with Vite, so I cannot try that out.
Contributor guide
Research direction
Read src/plugin/timezone/index.js at the reported line and reproduce the Invalid date error in IE11 with the date-time-format-timezone polyfill. Compare the browser-console behavior with the polyfill examples; done means reaching a maintainer-confirmed resolution for IE11 support, such as a tested compatibility change or clear documentation of the limitation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- localization
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100