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

FIX: Ensure dates passed in query params are parsed in the local timezone. #365

Merged
merged 1 commit into from
Mar 14, 2025

Conversation

pento
Copy link
Member

@pento pento commented Mar 14, 2025

✨ What's This?

When passing date values for reports as URL parameters, they were being parsed by the standard JavaScript Date object, which due to legacy reasons parses date-only strings in UTC, all other date formats are assumed to be in the browser's local timezone.

This change switches to using moment's parser, which assumes that all strings passed to it are in the browser's local timezone.

👑 Testing

  • Change your computer to be in a timezone with a different date to the current UTC date.
  • Visit a group report that requires a date parameter. Select a date, and run the report.
  • Copy the current URL into a new tab, and confirm that the date displayed stays the same.

@pento pento self-assigned this Mar 14, 2025
@pento pento merged commit 8589c56 into main Mar 14, 2025
6 checks passed
@pento pento deleted the pento/fix-parsing-date-query-params branch March 14, 2025 03:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants