From b86ed18534d4a0b2305b2d73c39cd420259e2134 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 19 Feb 2017 23:17:22 +0100 Subject: [PATCH] subtract 1 ms from all-day events to hotfix some glitches --- .../kotlin/com/simplemobiletools/calendar/helpers/DBHelper.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/helpers/DBHelper.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/helpers/DBHelper.kt index 26436e02a..ac3ced8b1 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/helpers/DBHelper.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/helpers/DBHelper.kt @@ -394,7 +394,7 @@ class DBHelper private constructor(val context: Context) : SQLiteOpenHelper(cont do { val id = cursor.getIntValue(COL_ID) val startTS = cursor.getIntValue(COL_START_TS) - val endTS = cursor.getIntValue(COL_END_TS) + var endTS = cursor.getIntValue(COL_END_TS) val reminder1Minutes = cursor.getIntValue(COL_REMINDER_MINUTES) val reminder2Minutes = cursor.getIntValue(COL_REMINDER_MINUTES_2) val reminder3Minutes = cursor.getIntValue(COL_REMINDER_MINUTES_3) @@ -405,6 +405,8 @@ class DBHelper private constructor(val context: Context) : SQLiteOpenHelper(cont val flags = cursor.getIntValue(COL_FLAGS) val repeatLimit = cursor.getIntValue(COL_REPEAT_LIMIT) val eventType = cursor.getIntValue(COL_EVENT_TYPE) + if (flags and FLAG_ALL_DAY != 0) + endTS -= 1 events.add(Event(id, startTS, endTS, title, description, reminder1Minutes, reminder2Minutes, reminder3Minutes, repeatInterval, importId, flags, repeatLimit, eventType)) } while (cursor.moveToNext())