subtract a day from all-day events lasting multiple days

This commit is contained in:
tibbi 2017-07-17 20:42:43 +02:00
parent 31061141d8
commit 34e1717dcd
1 changed files with 5 additions and 0 deletions

View File

@ -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) {}
}