Fix Date.toString() showing StandardName instead of DaylightName during DST - #2329
Merged
Merged
Conversation
… DST periods Co-authored-by: lahma <171892+lahma@users.noreply.github.com>
lahma
force-pushed
the
copilot/analyze-discussion-2328
branch
from
March 16, 2026 19:41
2f051d3 to
ecadcdb
Compare
…specific exception type Co-authored-by: lahma <171892+lahma@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Analyze discussion to determine if a bug exists
Fix Date.toString() showing StandardName instead of DaylightName during DST
Mar 16, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Updates Jint’s Date.prototype.toString() / toTimeString() timezone suffix to use the daylight vs. standard timezone name depending on whether the represented instant is in DST, aligning output with typical host behavior and improving correctness for summer dates.
Changes:
- Updated
DatePrototype.TimeZoneStringto selectDaylightNamevsStandardNamewhen the date is within the supportedDateTimeOffsetrange. - Adjusted existing runtime tests to expect DST-aware timezone names (e.g., “Pacific Daylight Time” in June).
- Added a new regression test asserting DST vs standard timezone name selection for an Eastern timezone.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
Jint/Native/Date/DatePrototype.cs |
Chooses daylight vs standard timezone name when formatting timezone suffix. |
Jint.Tests/Runtime/EngineTests.cs |
Updates expected strings to reflect DST-aware timezone naming. |
Jint.Tests/Runtime/DateTests.cs |
Adds coverage for DST/standard name selection in toString(). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
lahma
approved these changes
Mar 16, 2026
lahma
marked this pull request as ready for review
March 16, 2026 19:53
lahma
enabled auto-merge (squash)
March 16, 2026 19:53
This was referenced Mar 23, 2026
This was referenced Jun 8, 2026
This was referenced Jun 29, 2026
This was referenced Jul 7, 2026
This was referenced Jul 22, 2026
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.
Date.prototype.toString()andtoTimeString()always used the timezone'sStandardNamein the parenthetical suffix, even for dates falling within a DST period. For example, a summer date in the Eastern timezone would incorrectly show(Eastern Standard Time)instead of(Eastern Daylight Time).Changes
DatePrototype.TimeZoneString(): CheckTimeZoneInfo.IsDaylightSavingTime()for the specific timestamp and useDaylightNameorStandardNameaccordingly. Dates outside theDateTimeOffsetrepresentable range (year < 0001 or > 9999) fall back toStandardName.ToStringUsesDaylightNameWhenInDst: verifies that a summer date returns theDaylightNameand a winter date returns theStandardName.EngineTests.csthat had incorrect hardcoded expectations — they asserted(Pacific/Eastern Standard Time)for dates that are actually in DST, masking the bug.💬 Send tasks to Copilot coding agent from Slack and Teams to turn conversations into code. Copilot posts an update in your thread when it's finished.