From dbf692450fe28c60cae08839a88864f2d87fb0dd Mon Sep 17 00:00:00 2001 From: tibbi Date: Fri, 17 Apr 2020 17:18:06 +0200 Subject: [PATCH] fix #1114, properly handle repeating by weekdays, if repetition is daily --- .../com/simplemobiletools/calendar/pro/helpers/Parser.kt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/helpers/Parser.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/helpers/Parser.kt index 6091ecd61..81e480568 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/helpers/Parser.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/helpers/Parser.kt @@ -40,6 +40,12 @@ class Parser { if (interval.areDigitsOnly() && interval.toInt() % 7 == 0) { val dateTime = Formatter.getDateTimeFromTS(startTS) repeatRule = Math.pow(2.0, (dateTime.dayOfWeek - 1).toDouble()).toInt() + } else if (fullString.contains("BYDAY")) { + // some services use weekly repetition for repeating on specific week days, some use daily + // make these produce the same result + // RRULE:FREQ=DAILY;BYDAY=MO,TU,WE,TH,FR + // RRULE:FREQ=WEEKLY;BYDAY=MO,TU,WE,TH,FR + repeatInterval = WEEK_SECONDS } } } else if (key == COUNT) {