Skip to content

Commit

Permalink
ical-org#197 Fixed comparison bug for Until; also removed a conversio…
Browse files Browse the repository at this point in the history
…n step since it is now an IDateTime/CalDateTime.
  • Loading branch information
Colin Ng committed Jan 30, 2017
1 parent 800594d commit 44753ff
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion v3/ical.NET/Evaluation/RecurrencePatternEvaluator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ private HashSet<DateTime> GetDates(IDateTime seed, DateTime periodStart, DateTim
else if (pattern.Until.Value == DateTime.MinValue || candidate <= pattern.Until.Value)
{
var utcCandidate = DateUtil.FromTimeZoneToTimeZone(candidate, DateUtil.GetZone(seed.TzId), DateTimeZone.Utc).ToDateTimeUtc();
if (!dates.Contains(candidate) && (pattern.Until == DateTime.MinValue || utcCandidate <= pattern.Until))
if (!dates.Contains(candidate) && (pattern.Until.Value == DateTime.MinValue || utcCandidate <= pattern.Until.AsUtc))
{
dates.Add(candidate);
}
Expand Down
3 changes: 1 addition & 2 deletions v3/ical.NET/Utility/DateUtil.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,7 @@ public static IDateTime MatchTimeZone(IDateTime dt1, IDateTime dt2)
// The first date/time is in UTC time, convert!
return new CalDateTime(copy.AsUtc);
}
// The first date/time is in local time, convert!
return new CalDateTime(copy.AsSystemLocal);
return copy;
}

public static DateTime AddWeeks(DateTime dt, int interval, DayOfWeek firstDayOfWeek)
Expand Down

0 comments on commit 44753ff

Please sign in to comment.