New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Timezones: Include IANA timezone canonical name in TimeZoneInfo #27591
Conversation
if (!momentTz) { | ||
return undefined; | ||
} | ||
|
||
return { | ||
name: timeZone, | ||
ianaName: momentTz.name, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the proper name is olsonId.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did a quick check on this and seems like there is no clear winner;) I think I'll stay with iana as Wikipedia states Olson database is occasionally used in as a name of this DB
@@ -1,3 +1,5 @@ | |||
process.env.TZ = 'UTC'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess this is deliberate, but feels very strange.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, had the same feeling but apparently this is the way jest wants the time zone to be set. I have not found any other way to get the timezone "mocked".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great Dominik, I just left a minor nit.
Ref: https://www.iana.org/time-zones , https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
This PR also sets the global timezone for tests to UTC.