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 TimeZoneInfo.HasIanaId when using Local Time Zone #58392

Merged
merged 5 commits into from
Aug 31, 2021

Conversation

tarekgh
Copy link
Member

@tarekgh tarekgh commented Aug 30, 2021

#58326

We have exposed the new property TimeZoneInfo.HasIanaId in .NET 6.0. This property tells if the Time Zone object is created with IANA Id. This property returns the correct results except when using TimeZoneInfo.Local. The reason is when we initialize TimeZoneInfo.Local property we clone the object before returning it, but we missed cloning HasIanaId property inside the returned object. The fix is to ensure HasIanaId is initialized correctly in TimeZoneInfo.Local.

@ghost
Copy link

ghost commented Aug 30, 2021

Tagging subscribers to this area: @tarekgh, @safern
See info in area-owners.md if you want to be subscribed.

Issue Details

#58326

We have exposed the new property TimeZoneInfo.HasIanaId in .NET 6.0. This property tells if the Time Zone object is created with IANA Id. This property returns the correct results except when using TimeZoneInfo.Local. The reason is when we initialize TimeZoneInfo.Local property we clone the object before returning it, but we missed cloning HasIanaId property in that object. The fix is to ensure HasIanaId is initialized correctly in TimeZoneInfo.Local.

Author: tarekgh
Assignees: -
Labels:

area-System.Globalization

Milestone: -

Copy link
Member

@eerhardt eerhardt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes LGTM.

@tarekgh tarekgh merged commit 5fc0588 into dotnet:main Aug 31, 2021
@tarekgh tarekgh deleted the FixHasIanaIdWithLocalTimeZone branch August 31, 2021 01:43
@tarekgh
Copy link
Member Author

tarekgh commented Aug 31, 2021

/backport to release/6.0

@github-actions
Copy link
Contributor

Started backporting to release/6.0: https://github.com/dotnet/runtime/actions/runs/1184414702

@github-actions
Copy link
Contributor

@tarekgh backporting to release/6.0 failed, the patch most likely resulted in conflicts:

$ git am --3way --ignore-whitespace --keep-non-patch changes.patch

Applying: Fix TimeZoneInfo.HasIanaId when using Local Time Zone
Applying: Add more test
error: sha1 information is lacking or useless (src/libraries/System.Runtime/tests/System/TimeZoneInfoTests.cs).
error: could not build fake ancestor
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0002 Add more test
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
Error: The process '/usr/bin/git' failed with exit code 128

Please backport manually!

@ghost ghost locked as resolved and limited conversation to collaborators Sep 30, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants