Fix for parsing .ics file when the key BYMONTHDAY is present in the .ics file.

This commit is contained in:
saunaklogan 2020-05-04 21:23:21 +05:30
parent c5bc4afde9
commit 07f8685741
1 changed files with 5 additions and 2 deletions

View File

@ -60,8 +60,11 @@ class Parser {
} else if (repeatInterval.isXMonthlyRepetition() || repeatInterval.isXYearlyRepetition()) {
repeatRule = if (value.startsWith("-1")) REPEAT_ORDER_WEEKDAY_USE_LAST else REPEAT_ORDER_WEEKDAY
}
} else if (key == BYMONTHDAY && value.toInt() == -1) {
repeatRule = REPEAT_LAST_DAY
} else if (key == BYMONTHDAY) {
val byMonthDayValueArray = value.split(",")
val intFlag = byMonthDayValueArray.find { it.toInt() == -1 }
if (intFlag == null)
repeatRule = REPEAT_LAST_DAY
}
}
return EventRepetition(repeatInterval, repeatRule, repeatLimit)