TimezonePicker is too opinionated about "noisy" timezones
See original GitHub issueCurrent Behavior
I am situated in timezone “America/Guayaquil”. After scrambling over my timezone not being default selected and reading the TimezonePicker code, it looks like it’s filtering “noisy” timezones (and mine seems to be such). But that has the unwanted side effect of removing the option that could match with Intl.DateTimeFormat().resolvedOptions().timeZone;
which makes it either complicated or impossible to have the current user timezone default selected in the dropdown.
Expected Behavior
Filtering should consider the current user timezone and not filter that timezone to allow a default selection. In addition, it should either be possible to disable the filtering completely with a prop to get a complete unfiltered list.
Your Environment
Tech | Version |
---|---|
Base UI | v8.0.2 |
React | 16.8.6 |
browser | Chrome 75.x |
- I have searched the issues of this repository and believe that this is not a duplicate.
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
How can I get notified when the timezone-picker value is ...
I'm using timezone-picker to pick my timezones, and so far it's working great. However, the one problem is that I can't convince it...
Read more >It's Time We Addressed Time-Zone Selectors
Designing time-zone selectors can be tricky because: Time zones can change. A time zone can change its offset if it abides by daylight...
Read more >Time zone picker in System Settings does not show time ...
The below KB describes one of the reason why the time zone picker shows empty. In the console error we can see 400...
Read more >Case study: The UX of selecting timezones - Bootcamp
The first is very obvious: It is hard for a user to choose the correct value if they are not familiar with the...
Read more >Timezone Picker - Symphony Developers Documentation
With the Timezone Picker, Symphony users can easily select a timezone from a selection of possible values. It recognises both cities and countries...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Thanks again @jh3y!
Overriding in Baseweb is something I still am not too comfortable with, but it is really powerful. There really should be more examples of overrides like this in the docs site to get people started on tweaking and give inspiration to similar overrides.
Here’s my final solution, which dynamically uses the current user time zone, but only if not already existing in the default ones. The added option is sorted into the existing list which makes it possible to make it appear as if it was always there.
Hope it helps someone out!
Hey @jh3y!
Thanks for your feedback. I considered that option, but never got to try it. But if you are in fact in a time zone that’s already in the list, won’t I have duplicates? How can I know? I guess I can look at the list of countries before in some way.