From 777b1dc4ad49bdfb1505900e7a3e582f276b521f Mon Sep 17 00:00:00 2001 From: MiMoHo <37556964+MiMoHo@users.noreply.github.com> Date: Fri, 3 Jul 2026 21:00:46 +0200 Subject: [PATCH] fix: import weekday-only recurring events (FREQ=DAILY;BYDAY) Recurrences exported as RRULE:FREQ=DAILY;BYDAY=MO,TU,WE,TH,FR without an INTERVAL field (e.g. from Thunderbird/DAVx5) were imported as plain every-day events, showing on weekends too. The DAILY branch in parseRepeatInterval() was gated on the RRULE containing INTERVAL, so weekday-only daily rules skipped the conversion to weekly repetition and repeatInterval stayed DAY, making the later BYDAY handling a no-op. Enter the branch when either INTERVAL or BYDAY is present, and guard the interval-multiple check with an INTERVAL presence test so BYDAY-only rules convert to weekly repetition and produce the correct Mon-Fri bitmask, matching FREQ=WEEKLY;BYDAY handling. --- CHANGELOG.md | 2 ++ app/src/main/kotlin/org/fossify/calendar/helpers/Parser.kt | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 73a6fc1f1..85864ee6f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Fixed event text readability on colored backgrounds ([#1065]) - Fixed invisible current time indicator in weekly view ([#99]) - Fixed stuck zoom level in weekly view on some devices ([#621]) +- Fixed importing recurring events that repeat only on weekdays (RRULE FREQ=DAILY with BYDAY, e.g. from Thunderbird), which were previously shown on every day including weekends ([#232]) ## [1.10.3] - 2026-02-14 ### Changed @@ -219,6 +220,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 [#148]: https://github.com/FossifyOrg/Calendar/issues/148 [#196]: https://github.com/FossifyOrg/Calendar/issues/196 [#217]: https://github.com/FossifyOrg/Calendar/issues/217 +[#232]: https://github.com/FossifyOrg/Calendar/issues/232 [#262]: https://github.com/FossifyOrg/Calendar/issues/262 [#337]: https://github.com/FossifyOrg/Calendar/issues/337 [#393]: https://github.com/FossifyOrg/Calendar/issues/393 diff --git a/app/src/main/kotlin/org/fossify/calendar/helpers/Parser.kt b/app/src/main/kotlin/org/fossify/calendar/helpers/Parser.kt index 535ff4815..585fc69a7 100644 --- a/app/src/main/kotlin/org/fossify/calendar/helpers/Parser.kt +++ b/app/src/main/kotlin/org/fossify/calendar/helpers/Parser.kt @@ -35,10 +35,10 @@ class Parser { repeatRule = 1 shl (start.dayOfWeek - 1) } else if (value == MONTHLY || value == YEARLY) { repeatRule = REPEAT_SAME_DAY - } else if (value == DAILY && fullString.contains(INTERVAL)) { + } else if (value == DAILY && (fullString.contains(INTERVAL) || fullString.contains("BYDAY"))) { val interval = fullString.substringAfter("$INTERVAL=").substringBefore(";") // properly handle events repeating by 14 days or so, just add a repeat rule to specify a day of the week - if (interval.areDigitsOnly() && interval.toInt() % 7 == 0) { + if (fullString.contains(INTERVAL) && interval.areDigitsOnly() && interval.toInt() % 7 == 0) { val dateTime = Formatter.getDateTimeFromTS(startTS) repeatRule = 1 shl (dateTime.dayOfWeek - 1) } else if (fullString.contains("BYDAY")) {