-
Notifications
You must be signed in to change notification settings - Fork 248
Open
Labels
Description
Describe the bug
CalDateTime.Add(Duration.FromDays(1) and CalDateTime.AddDay(1) do not return the same result.
To Reproduce
[Test]
public void AddOneDay()
{
// Start Time: March 29, 2025, at 02:30 CET.
// DST transition on March 30, 2025 at 02:00
var dt = new CalDateTime(2025, 3, 29, 2, 30, 0, tzId: "Europe/Berlin");
var resultFromDuration = dt.Add(Duration.FromDays(1));
var resultAddDays = dt.AddDays(1);
Assert.That(resultFromDuration.Value, Is.EqualTo(resultAddDays.Value));
}Same with other arithmetic operations with nominal values.
Expected behavior
Results should be equal.
Environment:
- OS: Windows 11
- .NET version: NET8.0
- ical.net version: 5.1.0