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

Setting CalDateTime's TzId to a new value does not reset the AsUtc value #387

Closed
rianjs opened this issue May 21, 2018 · 1 comment
Closed

Comments

@rianjs
Copy link
Collaborator

rianjs commented May 21, 2018

If you call calDateTime.AsUtc and then change the TzId property, AsUtc continues to return the old, cached value.

[Test]
public void TestTzidChanges()
{
    var someTime = DateTimeOffset.Parse("2018-05-21T11:35:00-04:00");

    var someDt = new CalDateTime(someTime.DateTime) { TzId = "America/New_York" };
    var firstUtc = someDt.AsUtc;
    Assert.AreEqual(someTime.UtcDateTime, firstUtc);

    someDt.TzId = "Europe/Berlin";
    var berlinUtc = someDt.AsUtc;
    Assert.AreNotEqual(firstUtc, berlinUtc);
}
rianjs pushed a commit that referenced this issue May 21, 2018
rianjs pushed a commit that referenced this issue May 21, 2018
rianjs added a commit that referenced this issue May 21, 2018
@rianjs
Copy link
Collaborator Author

rianjs commented May 21, 2018

nuget package 4.1.1
https://www.nuget.org/packages/Ical.Net

@rianjs rianjs closed this as completed May 21, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant