mirror of
https://github.com/SimpleMobileTools/Simple-Calendar.git
synced 2025-02-17 12:20:51 +01:00
dont count event reminders as a jerk
This commit is contained in:
parent
e4fe47f81b
commit
b8c2103431
@ -42,6 +42,9 @@ fun Context.updateListWidget() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun Context.scheduleNextEventReminder(event: Event) {
|
fun Context.scheduleNextEventReminder(event: Event) {
|
||||||
|
if (event.getReminders().isEmpty())
|
||||||
|
return
|
||||||
|
|
||||||
var startTS = event.startTS - event.reminder1Minutes * 60
|
var startTS = event.startTS - event.reminder1Minutes * 60
|
||||||
var newTS = startTS
|
var newTS = startTS
|
||||||
if (event.repeatInterval == DAY || event.repeatInterval == WEEK || event.repeatInterval == BIWEEK) {
|
if (event.repeatInterval == DAY || event.repeatInterval == WEEK || event.repeatInterval == BIWEEK) {
|
||||||
|
@ -31,16 +31,7 @@ data class Event(var id: Int = 0, var startTS: Int = 0, var endTS: Int = 0, var
|
|||||||
|
|
||||||
val isAllDay = flags and FLAG_ALL_DAY != 0
|
val isAllDay = flags and FLAG_ALL_DAY != 0
|
||||||
|
|
||||||
fun getRemindersCount(): Int {
|
fun getRemindersCount() = getReminders().count()
|
||||||
var cnt = 0
|
|
||||||
if (reminder1Minutes != REMINDER_OFF)
|
|
||||||
cnt++
|
|
||||||
if (reminder2Minutes != REMINDER_OFF)
|
|
||||||
cnt++
|
|
||||||
if (reminder3Minutes != REMINDER_OFF)
|
|
||||||
cnt++
|
|
||||||
return cnt
|
|
||||||
}
|
|
||||||
|
|
||||||
fun getReminders() = arrayOf(reminder1Minutes, reminder2Minutes, reminder3Minutes).filter { it != REMINDER_OFF }
|
fun getReminders() = setOf(reminder1Minutes, reminder2Minutes, reminder3Minutes).filter { it != REMINDER_OFF }
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user