Skip to content
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

TimeZone Toggle Feature for Date Display #2632

Open
wants to merge 2 commits into
base: alpha
Choose a base branch
from

Conversation

badboy-tian
Copy link

@badboy-tian badboy-tian commented Dec 13, 2024

New Pull Request Checklist

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

  1. Added new TimeZoneToggle component:

    • Simple toggle switch with visual feedback (grey/green)
    • Persists user preference in localStorage
    • Displays UTC/Local indicator
  2. 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
  3. 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
    image
    ####After
    image

I am in china. so the local time = utc + 8 hour

Copy link

parse-github-assistant bot commented Dec 13, 2024

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: #123 in the PR description, so I can recognize it.

Copy link

uffizzi-cloud bot commented Dec 13, 2024

Uffizzi Ephemeral Environment deployment-59082

⌚ Updated Dec 13, 2024, 08:10 UTC

☁️ https://app.uffizzi.com/github.com/parse-community/parse-dashboard/pull/2632

📄 View Application Logs etc.

What is Uffizzi? Learn more

@mtrezza
Copy link
Member

mtrezza commented Dec 13, 2024

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 image 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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants