properly show events repeating monthly the last day of the month

This commit is contained in:
tibbi 2017-05-08 19:10:56 +02:00
parent 0463f176ea
commit 109f3a3f3e
1 changed files with 5 additions and 1 deletions

View File

@ -25,7 +25,11 @@ data class Event(var id: Int = 0, var startTS: Int = 0, var endTS: Int = 0, var
if (repeatInterval % YEAR == 0) { if (repeatInterval % YEAR == 0) {
currStart.plusYears(repeatInterval / YEAR) currStart.plusYears(repeatInterval / YEAR)
} else if (repeatInterval % MONTH == 0) { } else if (repeatInterval % MONTH == 0) {
currStart.plusMonths(repeatInterval / MONTH) if (repeatRule == REPEAT_MONTH_LAST_DAY) {
currStart.plusMonths(repeatInterval / MONTH).dayOfMonth().withMaximumValue()
} else {
currStart.plusMonths(repeatInterval / MONTH)
}
} else if (repeatInterval % WEEK == 0) { } else if (repeatInterval % WEEK == 0) {
// step through weekly repetition by days too, as events can trigger multiple times a week // step through weekly repetition by days too, as events can trigger multiple times a week
currStart.plusDays(1) currStart.plusDays(1)