Timezones with the same identifier defaults to the first in the list
Summary
We are letting user's save their current location and timezone preference, but some locations share the same timezone identifier. Regardless of the location you select, the first timezone that matches the identifier will be selected.
For example
{"name":"International Date Line West","offset":-39600,"identifier":"Pacific/Midway"}
{"name":"Midway Island","offset":-39600,"identifier":"Pacific/Midway"}
If we select Midway island
then refresh the page, International Date Line West
will be selected
Steps to reproduce
- Enable the
user_time_settings
feature flag - Navigate to user profile
/profile
- Select "Midway Island" as your timezone and save
- Refresh the page
- "International Date Line West" will now be selected
What is the current bug behavior?
The first timezone that matches the identifier is selected
What is the expected correct behavior?
The timezone you select should be selected
Possible fixes
- On page load, populate the hidden
user[timezone]
field with the timezone name, instead of identifier - Select the timezone by name instead of identifier