tweaking a repetition rule check

This commit is contained in:
Tibor Kaputa 2020-05-05 09:50:15 +02:00 committed by GitHub
parent 0b07825fd3
commit 5538daf409
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 3 deletions

View File

@ -61,12 +61,11 @@ class Parser {
repeatRule = if (value.startsWith("-1")) REPEAT_ORDER_WEEKDAY_USE_LAST else REPEAT_ORDER_WEEKDAY
}
} else if (key == BYMONTHDAY) {
val byMonthDayValueArray = value.split(",")
val intFlag = byMonthDayValueArray.find { it.toInt() == -1 }
if (intFlag != null)
if (value.split(",").any { it.toInt() == -1 }) {
repeatRule = REPEAT_LAST_DAY
}
}
}
return EventRepetition(repeatInterval, repeatRule, repeatLimit)
}