mirror of
https://github.com/SimpleMobileTools/Simple-Calendar.git
synced 2024-12-25 07:50:56 +01:00
fix #599, properly determing if all-day events are running, or not
This commit is contained in:
parent
ec2b71e1c0
commit
729a632cf3
@ -939,7 +939,12 @@ class DBHelper private constructor(val context: Context) : SQLiteOpenHelper(cont
|
||||
repeatRule = REPEAT_SAME_DAY
|
||||
}
|
||||
|
||||
val isPastEvent = endTS < getNowSeconds()
|
||||
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,
|
||||
repeatInterval, importId, flags, repeatLimit, repeatRule, eventType, ignoreEventOccurrences, offset, isDstIncluded,
|
||||
@ -1070,5 +1075,12 @@ class DBHelper private constructor(val context: Context) : SQLiteOpenHelper(cont
|
||||
}
|
||||
}
|
||||
|
||||
private fun getIsPastEvent(event: Event) = event.endTS < getNowSeconds()
|
||||
private fun getIsPastEvent(event: Event): Boolean {
|
||||
val endTSToCheck = if (event.startTS < getNowSeconds() && event.getIsAllDay()) {
|
||||
Formatter.getDayEndTS(Formatter.getDayCodeFromTS(event.endTS))
|
||||
} else {
|
||||
event.endTS
|
||||
}
|
||||
return endTSToCheck < getNowSeconds()
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user