Fix #71: Implement BYSETPOS in RecurrenceEngineV2#125
Merged
thedhanawada merged 1 commit intomasterfrom Mar 20, 2026
Merged
Conversation
BYSETPOS was a TODO stub that only advanced the month without selecting from the candidate set. Now generates all matching weekday occurrences in the month based on byDay rules, then applies BYSETPOS indices (1-based positive from start, negative from end) to select from that set. Supports patterns like "last Friday of every month" (BYSETPOS=-1). Fixes #71
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
Implemented BYSETPOS selection logic in
getNextMonthly()(RecurrenceEngineV2.js:311-343).The previous code was a TODO stub that only advanced the month. Now:
Supports patterns like:
FREQ=MONTHLY;BYDAY=FR;BYSETPOS=-1(last Friday of every month)FREQ=MONTHLY;BYDAY=MO,TU,WE,TH,FR;BYSETPOS=-1(last weekday of month)Files Changed
core/events/RecurrenceEngineV2.js— 34 lines added, 2 removedFixes #71