parse-dashboard
parse-dashboard copied to clipboard
TimeZone Toggle Feature for Date Display
New Pull Request Checklist
- [x] I am not disclosing a vulnerability.
- [ ] I am creating this PR in reference to an issue.
Issue Description
Add timezone toggle feature to allow switching between UTC and local time display for date fields in the data browser. Currently, dates are always displayed in UTC format which can be confusing for users working in different timezones.
Closes: n/a
Approach
-
Added new TimeZoneToggle component:
- Simple toggle switch with visual feedback (grey/green)
- Persists user preference in localStorage
- Displays UTC/Local indicator
-
Modified date handling:
- Updated DateTimeEditor to consistently use UTC format during editing
- Added formatDateTime utility for consistent date formatting
- Implemented timezone conversion in BrowserRow component
-
UI Integration:
- Added timezone toggle to BrowserToolbar
- Maintained UTC format in edit mode for data consistency
- Added useLocalTime prop propagation through component hierarchy
TODOs before merging
- [ ] Add tests
- [ ] Add changes to documentation (guides, repository pages, in-code descriptions)
####Before
####After
I am in china. so the local time = utc + 8 hour
Thanks for opening this pull request!
- ❌ Please link an issue that describes the reason for this pull request, otherwise your pull request will be closed. Make sure to write it as
Closes: #123in the PR description, so I can recognize it.
Uffizzi Ephemeral Environment deployment-59082
:watch: Updated Dec 13, 2024, 08:10 UTC
:cloud: https://app.uffizzi.com/github.com/parse-community/parse-dashboard/pull/2632
:page_facing_up: View Application Logs etc.
What is Uffizzi? Learn more
Nice! I'm don't think most users will toggle often back and forth, so I suggest to remove the toggle and instead add a button between "Export" and "Refresh". Then add a menu item that toggles between "Show dates in UTC" and "Show dates in local time".
Is this feature only for date display, or also for date entry, so that when entering a date in local time, and the date display is set to local, it will be converted to UTC before sending it to Parse Server?
Could you please also link the related issue?