You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm having some issues with parsing timezones with zero offsets.
Issue description
I have unexpected results when applying locale for the dayjs object in UTC and timezone with zero offsets. When I call the locale method after .tz() looks like the locale method is changed date-time according to my local time. But with timezones which is different from UTC, everything works fine.
The date argument in that case is a date string in ISO format. Timezone is the string, locale is the string with one of the dayjs locales. Everything works fine until I pass the timezone with zero offsets. I've tried to test this behavior and found that the issue is probably in the clone method
Logs
Date argument is 2022-02-27T11:05:51.439Z in ISO format
I've got the same problem when I passed in the timezone "UTC":
dayjs.tz("2023-12-06T07:43:14.674Z", "UTC").locale("en").format("LT") returns wrong value 12:43 AM dayjs.tz("2023-12-06T07:43:14.674Z", "UTC").format("LT") returns the expected value 7:43 AM
I'm having some issues with parsing timezones with zero offsets.
Issue description
I have unexpected results when applying locale for the
dayjs
object in UTC and timezone with zero offsets. When I call thelocale
method after.tz()
looks like thelocale
method is changed date-time according to my local time. But with timezones which is different from UTC, everything works fine.Code
My plugins
I don't import locales here, but I import them dynamically after a user selects a specific locale.
Code with issues
The date argument in that case is a date string in ISO format. Timezone is the string, locale is the string with one of the dayjs locales. Everything works fine until I pass the timezone with zero offsets. I've tried to test this behavior and found that the issue is probably in the
clone
methodLogs
Date argument is
2022-02-27T11:05:51.439Z
in ISO formatCode
Results
Expected behavior
The date and time should be the same after
locale
method callInformation
1.11.7
Windows 10 (64-bit)
Firefox 110.0 (64-bit)
Europe/Warsaw [UTC + 01:00]
The text was updated successfully, but these errors were encountered: