diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/helpers/IcsImporter.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/helpers/IcsImporter.kt index f9f72fc42..55e2fbc59 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/helpers/IcsImporter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/helpers/IcsImporter.kt @@ -14,8 +14,9 @@ import com.simplemobiletools.calendar.pro.models.EventType import com.simplemobiletools.calendar.pro.models.Reminder import com.simplemobiletools.commons.extensions.areDigitsOnly import com.simplemobiletools.commons.extensions.showErrorToast -import java.io.File +import com.simplemobiletools.commons.helpers.HOUR_SECONDS import org.joda.time.DateTimeZone +import java.io.File class IcsImporter(val activity: SimpleActivity) { enum class ImportResult { @@ -241,6 +242,13 @@ class IcsImporter(val activity: SimpleActivity) { if (event.getIsAllDay() && curEnd > curStart) { event.endTS -= DAY + + // fix some glitches related to daylight saving shifts + if (event.startTS - event.endTS == HOUR_SECONDS.toLong()) { + event.endTS += HOUR_SECONDS + } else if (event.startTS - event.endTS == -HOUR_SECONDS.toLong()) { + event.endTS -= HOUR_SECONDS + } } if (event.importId.isEmpty()) {