diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/extensions/Event.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/extensions/Event.kt index d69789877..e9d2c8847 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/extensions/Event.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/extensions/Event.kt @@ -5,7 +5,7 @@ import com.simplemobiletools.calendar.pro.helpers.TWELVE_HOURS import com.simplemobiletools.calendar.pro.models.Event import org.joda.time.DateTimeZone -/** Shifts all-day events to local timezone such that the event starts and ends on the same time as in UTC */ +// shifts all-day events to local timezone such that the event starts and ends on the same time as in UTC fun Event.toLocalAllDayEvent() { require(this.getIsAllDay()) { "Must be an all day event!" } @@ -17,13 +17,14 @@ fun Event.toLocalAllDayEvent() { } } -/** Shifts all-day events to UTC such that the event starts on the same time in UTC too */ +// shifts all-day events to UTC such that the event starts on the same time in UTC too fun Event.toUtcAllDayEvent() { require(getIsAllDay()) { "Must be an all day event!" } if (endTS >= startTS) { endTS += TWELVE_HOURS } + timeZone = DateTimeZone.UTC.id startTS = Formatter.getShiftedUtcTS(startTS) endTS = Formatter.getShiftedUtcTS(endTS)