fix: import weekday-only recurring events (FREQ=DAILY;BYDAY)#1239
Open
MiMoHo wants to merge 1 commit into
Open
fix: import weekday-only recurring events (FREQ=DAILY;BYDAY)#1239MiMoHo wants to merge 1 commit into
MiMoHo wants to merge 1 commit into
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Type of change(s)
What changed and why
Recurring events exported as
RRULE:FREQ=DAILY;BYDAY=MO,TU,WE,TH,FRwithout anINTERVALfield (the format Thunderbird / DAVx5 use for "repeat every weekday") were imported as plain every-day events and therefore also appeared on Saturdays and Sundays (issue #232).In
Parser.parseRepeatInterval(), theFREQ=DAILYbranch that converts a weekday-restricted daily rule into a weekly repetition was gated on the RRULE containingINTERVAL:When only
BYDAY(and noINTERVAL) is present, this branch is skipped, sorepeatIntervalstaysDAY(86400). The laterBYDAYhandler is then a no-op becauserepeatInterval.isXWeeklyRepetition()is false for a daily interval, so no weekday bitmask is ever applied and the event repeats every day.The fix enters the branch when either
INTERVALorBYDAYis present, and additionally guards the "interval is a multiple of 7" check with anINTERVALpresence test (soBYDAY-only rules fall through to theBYDAYconversion and never callinterval.toInt()on a non-numeric value):This sets
repeatInterval = WEEK_SECONDS(604800), so the existingBYDAYhandler produces the correct Mon-Fri bitmask, makingFREQ=DAILY;BYDAY=...behave identically toFREQ=WEEKLY;BYDAY=.... All previously handled cases (plainFREQ=DAILY,FREQ=DAILY;INTERVAL=n,FREQ=DAILY;INTERVAL=14,FREQ=DAILY;INTERVAL=1;BYDAY=...) keep their prior behavior.Tests performed
Built the
fossDebugvariant and verified on an Android 15 (API 35) emulator:Imported ICS with RRULE:FREQ=DAILY;BYDAY=MO,TU,WE,TH,FR (DTSTART Mon 2026-07-06). Month view shows 'Weekday standup' on every weekday (Mon-Fri) and absent on all weekends. Event detail shows repetition = Weekly, Repeat on Mon,Tue,Wed,Thu,Fri (not plain Daily).
Also confirmed
detekt,lint, unit tests and the build all pass locally (CI-equivalent).Closes the following issue(s)
Checklist
CHANGELOG.md(if applicable).Coded with Opus 4.8 ultracode.