-
Notifications
You must be signed in to change notification settings - Fork 147
fix(utils): resolve Safari date parsing issue by normalizing ISO strings #874
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
Open
messiawrq-design
wants to merge
1
commit into
ritesh-1918:main
Choose a base branch
from
messiawrq-design:fix/safari-date-parsing
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+11
−3
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Oops, something went wrong.
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.
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.
🧩 Analysis chain
🌐 Web query:
In JavaScript Date parsing (ECMAScript / MDN), are ISO-8601 strings with negative offsets like 2026-05-31T10:00:00-05:00 valid, and would appending Z to them make them invalid or change meaning?💡 Result:
In JavaScript, ISO-8601 strings with a negative timezone offset, such as 2026-05-31T10:00:00-05:00, are valid and correctly parsed by the Date constructor and Date.parse [1][2][3]. Appending a Z to an ISO-8601 string that already includes a timezone offset is technically invalid according to the ECMAScript specification for date time strings [4]. While some lenient parsers might ignore the extra suffix, it is generally considered an invalid date format in JavaScript and will frequently result in an Invalid Date (NaN) [1][4][5]. Regarding meaning, the Z suffix explicitly denotes UTC (Coordinated Universal Time) [2][6][7]. If a string includes both a timezone offset (e.g., -05:00) and the Z suffix, the presence of conflicting timezone information renders the string ambiguous or invalid [4]. For clear and robust code, you should either use the offset to represent local time relative to UTC or use the Z suffix to represent absolute UTC time, but never both in the same string [2][3].
Citations:
🏁 Script executed:
Repository: ritesh-1918/HELPDESK.AI
Length of output: 110
🏁 Script executed:
Repository: ritesh-1918/HELPDESK.AI
Length of output: 4129
🏁 Script executed:
Repository: ritesh-1918/HELPDESK.AI
Length of output: 509
Handle negative timezone offsets before appending
ZinformatTimelineDate. [major issue]dateStr.includes('+')misses valid ISO offsets like-05:00, so the code appendsZand produces an invalid timestamp (new Date("...-05:00Z")→Invalid Date). Update timezone detection to explicitly matchZor±HH:MMsuffix.Proposed fix
🤖 Prompt for AI Agents