-
Notifications
You must be signed in to change notification settings - Fork 13.8k
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
feat: add timezone selector component #15880
feat: add timezone selector component #15880
Conversation
Codecov Report
@@ Coverage Diff @@
## master #15880 +/- ##
=======================================
Coverage 77.09% 77.09%
=======================================
Files 984 985 +1
Lines 51782 51842 +60
Branches 7028 7067 +39
=======================================
+ Hits 39920 39967 +47
- Misses 11637 11650 +13
Partials 225 225
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
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.
This looks great!
SUMMARY
These changes add a new component for choosing timezones client side. It uses the timezone list from moment-timezone which has about 400 entries. To narrow that list for a UI dropdown, I have removed all duplicates (based on their standard and daylight timezone offsets). There is a map that makes some of these selections more readable; for example, "America/Los_Angeles" is a duplicate of Vancouver, so we map it to "Pacific Standard/Daylight Time". In a v2 I may see if there's a simple way to pull that name out of moment, but for now, there's a map of about 7-8 regions that seem to work.
There's a migration and some changes coming next that will implement this into reports. For now these changes should have no UI impact, and just introduce the component and storybook files.
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
Example from storybook showing "UTC" being mapped to GMT
TESTING INSTRUCTIONS
No visual changes in Superset yet, but you can test by running storybook
ADDITIONAL INFORMATION