From 03d114db50f01c46b0b93c832bf1c485e6fb5d20 Mon Sep 17 00:00:00 2001 From: Adrian Schoenig Date: Mon, 18 Sep 2017 15:04:10 +0200 Subject: [PATCH] Fix bug in computing recurrences in time zones < GMT --- Classes/core/CustomEvent/SGCustomEventRecurrenceRule.swift | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Classes/core/CustomEvent/SGCustomEventRecurrenceRule.swift b/Classes/core/CustomEvent/SGCustomEventRecurrenceRule.swift index aed698856..5e1e89e93 100644 --- a/Classes/core/CustomEvent/SGCustomEventRecurrenceRule.swift +++ b/Classes/core/CustomEvent/SGCustomEventRecurrenceRule.swift @@ -27,7 +27,9 @@ extension SGCustomEventRecurrenceRule { assert(startTime >= 0) assert(duration >= 0) - let gregorian = Calendar(identifier: .gregorian) + var gregorian = Calendar(identifier: .gregorian) + gregorian.timeZone = timeZone + var components = gregorian.dateComponents(in: timeZone, from: earliest) components.hour = 0 components.minute = 0