diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/asynctasks/FetchGoogleEventsTask.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/asynctasks/FetchGoogleEventsTask.kt index 580a31bb0..d6087deca 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/asynctasks/FetchGoogleEventsTask.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/asynctasks/FetchGoogleEventsTask.kt @@ -14,6 +14,7 @@ import com.simplemobiletools.calendar.activities.SettingsActivity import com.simplemobiletools.calendar.extensions.config import com.simplemobiletools.calendar.extensions.dbHelper import com.simplemobiletools.calendar.extensions.seconds +import com.simplemobiletools.calendar.helpers.DAY import com.simplemobiletools.calendar.helpers.FLAG_ALL_DAY import com.simplemobiletools.calendar.helpers.Parser import com.simplemobiletools.calendar.helpers.RRULE @@ -128,6 +129,10 @@ class FetchGoogleEventsTask(val activity: Activity, credential: GoogleAccountCre reminders.getOrElse(2, { -1 }), repeatRule.repeatInterval, importId, flags, repeatRule.repeatLimit, repeatRule.repeatRule, eventTypeId) + if (event.isAllDay && endTS > startTS) { + event.endTS -= DAY + } + importIDs.add(importId) dbHelper.insert(event) {} }