Fix RRULE BYDAY with multiple days only returning first day#80
Closed
Fix RRULE BYDAY with multiple days only returning first day#80
Conversation
Co-authored-by: OzzyCzech <105520+OzzyCzech@users.noreply.github.com>
…uplication Co-authored-by: OzzyCzech <105520+OzzyCzech@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix issue 75 in the project
Fix RRULE BYDAY with multiple days only returning first day
Jan 29, 2026
Owner
|
Your solution broke the test test('', function () {
$cal = new IcalParser();
$results = $cal->parseFile(__DIR__ . '/cal/daily_recur2.ics');
$events = $cal->getEvents()->sorted()->getArrayCopy();
Assert::equal(4, count($events));
Assert::equal('21.8.2017 00:00:00', $events[0]['DTSTART']->format('j.n.Y H:i:s'));
Assert::equal('28.8.2017 00:00:00', $events[1]['DTSTART']->format('j.n.Y H:i:s'));
Assert::equal('4.9.2017 00:00:00', $events[2]['DTSTART']->format('j.n.Y H:i:s'));
Assert::equal('11.9.2017 00:00:00', $events[3]['DTSTART']->format('j.n.Y H:i:s'));
}); |
Owner
|
@copilot can you address the issue that was made by your changes? |
Co-authored-by: OzzyCzech <105520+OzzyCzech@users.noreply.github.com>
Author
Fixed in commit 761dfe9. The issue was that my Freq.php change was unnecessary and broke the daily_recur2 test. The IcalParser.php fix alone correctly solves issue #75 without breaking existing tests. All tests now pass including daily_recur2. |
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.
Fix issue #75: Recurring events with BYDAY=TU,TH only returning one day
Summary
Fixed a bug where recurring events with
RRULE:FREQ=WEEKLY;BYDAY=TU,TH(or any multiple-day BYDAY rule) were only returning events for the first day instead of all specified days.Changes
Fixed
src/IcalParser.php(lines 214-241)INTERVAL * 7days from DTSTART, which fails for multiple BYDAY values (e.g., Tuesday and Thursday are only 2 days apart, not 7)INTERVAL * 7days from DTSTART)Added test case
tests/cal/75_weekly_tuesday_thursday.ics: Tests weekly recurring event with BYDAY=TU,THtests/events.recurring.phpt: Added test verifying all 11 occurrences (6 Tuesdays + 5 Thursdays) are returnedTesting
✅ Issue #75 resolved: BYDAY=TU,TH returns both Tuesday and Thursday events (11 total)
✅ Issue #61: Bi-weekly single-day test passes (INTERVAL=2, BYDAY=TU returns 3 events)
✅ daily_recur2: Weekly single-day without explicit INTERVAL passes (4 Monday events)
✅ Issue #38: Weekly multi-day test passes (BYDAY=MO,TU,WE,TH,FR)
✅ No security issues detected
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.