-
Notifications
You must be signed in to change notification settings - Fork 233
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
RecurrencePatternEvaluator treats DTSTART and UNTIL timezones incorrectly #406
Comments
@axunonb Problem still exists. |
See discussion on PR #574 |
Presently, it's the |
If we really wanted to stick to public override IEnumerable<Period> Evaluate(IDateTime referenceTime, DateTime? periodStart, DateTime? periodEnd, bool includeReferenceDateInResults)
{
if (periodStart is { Kind: DateTimeKind.Utc })
periodStart = new CalDateTime(periodStart.Value, "UTC").ToTimeZone(referenceTime.TzId).Value;
if (periodEnd is { Kind: DateTimeKind.Utc })
periodEnd = new CalDateTime(periodEnd.Value, "UTC").ToTimeZone(referenceTime.TzId).Value;
... oterh code Looks like at some time there was awareness of the problem with protected IDateTime ConvertToIDateTime(DateTime dt, IDateTime referenceDate)
{
IDateTime newDt = new CalDateTime(dt, referenceDate.TzId);
newDt.AssociateWith(referenceDate);
return newDt;
}
|
…e cleanup (#704) * Remove obsolete `IEvaluator.AssociatedObject` * Remove obsolete `Evaluator.ConvertToIDateTime()` * Enable `#nullable` for `Evaluator` classes. * Change `IEvaluator.Evaluate()` start/end params from `DateTime` to `IDateTime` to avoid ambiguity. * Add test `TestDtStartTimezone` from #406. * CalDateTime: Disallow initializing from `DateTimeKind.Local`. * Avoid using `DateTimeKind.Local` in test cases.
EventEvaluator
andRecurrencePatternEvaluator
seem to handleDTSTART
andUNTIL
's timezones incorrectly. It seems, thatRecurrencePatternEvaluator
doesn't consider the time zone of the start value passed intoRecurrencePatternEvaluator.Evaluate
orCalendarEvent.GetOccurrences
andUNTIL
must be specified as UTC (in most cases) according to RFC5545, but is treated as it would have the same time zone asDTSTART
.The following two test cases reproduce the problem (Europe/Vienna has offset UTC+2 in June 2018):
(The problem was observed on a device running in the Europe/Vienna timezone. Not sure, whether this has any relevance to the outcome.)
[Edit]: Might be related to #197
The text was updated successfully, but these errors were encountered: