mirror of
https://github.com/SimpleMobileTools/Simple-Calendar.git
synced 2025-01-12 16:55:05 +01:00
unify the way past events are checked
This commit is contained in:
parent
729a632cf3
commit
cc750cc9ba
@ -928,6 +928,7 @@ class DBHelper private constructor(val context: Context) : SQLiteOpenHelper(cont
|
|||||||
val source = cursor.getStringValue(COL_EVENT_SOURCE)
|
val source = cursor.getStringValue(COL_EVENT_SOURCE)
|
||||||
val location = cursor.getStringValue(COL_LOCATION)
|
val location = cursor.getStringValue(COL_LOCATION)
|
||||||
val color = eventTypeColors[eventType]
|
val color = eventTypeColors[eventType]
|
||||||
|
val isPastEvent = false
|
||||||
|
|
||||||
val ignoreEventOccurrences = if (repeatInterval != 0) {
|
val ignoreEventOccurrences = if (repeatInterval != 0) {
|
||||||
getIgnoredOccurrences(id)
|
getIgnoredOccurrences(id)
|
||||||
@ -939,16 +940,10 @@ class DBHelper private constructor(val context: Context) : SQLiteOpenHelper(cont
|
|||||||
repeatRule = REPEAT_SAME_DAY
|
repeatRule = REPEAT_SAME_DAY
|
||||||
}
|
}
|
||||||
|
|
||||||
val endTSToCheck = if (startTS < getNowSeconds() && flags and FLAG_ALL_DAY != 0) {
|
|
||||||
Formatter.getDayEndTS(Formatter.getDayCodeFromTS(endTS))
|
|
||||||
} else {
|
|
||||||
endTS
|
|
||||||
}
|
|
||||||
val isPastEvent = endTSToCheck < getNowSeconds()
|
|
||||||
|
|
||||||
val event = Event(id, startTS, endTS, title, description, reminder1Minutes, reminder2Minutes, reminder3Minutes,
|
val event = Event(id, startTS, endTS, title, description, reminder1Minutes, reminder2Minutes, reminder3Minutes,
|
||||||
repeatInterval, importId, flags, repeatLimit, repeatRule, eventType, ignoreEventOccurrences, offset, isDstIncluded,
|
repeatInterval, importId, flags, repeatLimit, repeatRule, eventType, ignoreEventOccurrences, offset, isDstIncluded,
|
||||||
0, lastUpdated, source, color, location, isPastEvent)
|
0, lastUpdated, source, color, location, isPastEvent)
|
||||||
|
event.isPastEvent = getIsPastEvent(event)
|
||||||
|
|
||||||
events.add(event)
|
events.add(event)
|
||||||
} while (cursor.moveToNext())
|
} while (cursor.moveToNext())
|
||||||
|
Loading…
Reference in New Issue
Block a user