mirror of
https://github.com/SimpleMobileTools/Simple-Calendar.git
synced 2025-06-05 21:59:17 +02:00
improve weekly and custom repetitions too
This commit is contained in:
@@ -37,10 +37,16 @@ data class Event(var id: Int = 0, var startTS: Int = 0, var endTS: Int = 0, var
|
|||||||
else -> currStart.plusMonths(repeatInterval / MONTH).dayOfMonth().withMaximumValue()
|
else -> currStart.plusMonths(repeatInterval / MONTH).dayOfMonth().withMaximumValue()
|
||||||
}
|
}
|
||||||
repeatInterval % WEEK == 0 -> {
|
repeatInterval % WEEK == 0 -> {
|
||||||
// step through weekly repetition by days too, as events can trigger multiple times a week
|
// step through weekly repetition by days, as events can trigger multiple times a week
|
||||||
currStart.plusDays(1)
|
startTS += DAY_SECONDS
|
||||||
|
endTS += DAY_SECONDS
|
||||||
|
return
|
||||||
|
}
|
||||||
|
else -> {
|
||||||
|
startTS += repeatInterval
|
||||||
|
endTS += repeatInterval
|
||||||
|
return
|
||||||
}
|
}
|
||||||
else -> currStart.plusSeconds(repeatInterval)
|
|
||||||
}
|
}
|
||||||
val newStartTS = newStart.seconds()
|
val newStartTS = newStart.seconds()
|
||||||
val newEndTS = newStartTS + (endTS - startTS)
|
val newEndTS = newStartTS + (endTS - startTS)
|
||||||
|
Reference in New Issue
Block a user