-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Closed
Labels
Description
Running
dayjs('2020-01-08T15:14:59.741774+00:00') .locale('es') .tz('America/New_York') .format('LLL')
gives January 8, 2020 10:14 AM instead of 8 de enero de 2020 10:14.
However, switching the order of locale and tz, e.g.
dayjs('2020-01-08T15:14:59.741774+00:00') .tz('America/New_York') .locale('es') .format('LLL')
gives the correct result of 8 de enero de 2020 10:14.
I believe this is the result of the following line of code, which overrides the current locale:
dayjs/src/plugin/timezone/index.js
Line 98 in a9d7d03
| const target = date.toLocaleString('en-US', { timeZone: timezone }) |
This is the intended behavior or is it something to be fixed to support the provided locale?
ohsory1324, timsand and NotSqrt