fix: parse date_utc as UTC in formatLocalTime for correct timezone conversion#37
Closed
Clav3rbot wants to merge 1 commit intoadn8naiagent:devfrom
Closed
fix: parse date_utc as UTC in formatLocalTime for correct timezone conversion#37Clav3rbot wants to merge 1 commit intoadn8naiagent:devfrom
Clav3rbot wants to merge 1 commit intoadn8naiagent:devfrom
Conversation
…nversion The date_utc field from FastF1 arrives as '2026-03-15 03:00:00' without a timezone suffix. JavaScript's Date constructor treats this as local time, so sessions were displayed with wrong times. Appends 'Z' (or converts space to 'T' + 'Z') so the string is parsed as UTC before converting to the user's local timezone.
Owner
|
Have restyled the times to show day and date and fixed time zone conversion. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Fixes
formatLocalTimeinSessionPicker.tsxto correctly parsedate_utctimestamps as UTC before converting to the user's local timezone.Why
Session timestamps from the backend arrive as UTC strings (format
YYYY-MM-DD HH:mm:ss) but were being parsed without explicit UTC designation, causing them to be interpreted as local time. This resulted in incorrect session times displayed to users in non-UTC timezones.How
Zsuffix todate_utcstrings before passing toDateconstructor so the browser correctly interprets them as UTC.