Skip to content

Add matches/occursOn convenience helpers and Strict RFC enforcement option#96

Merged
ggaabe merged 2 commits intomainfrom
strict-rfc-option
Jan 15, 2026
Merged

Add matches/occursOn convenience helpers and Strict RFC enforcement option#96
ggaabe merged 2 commits intomainfrom
strict-rfc-option

Conversation

@ggaabe
Copy link
Owner

@ggaabe ggaabe commented Jan 15, 2026

Summary

  • add matches() and occursOn() convenience helpers
  • document new helpers in README
  • add tests for exact instant, day-only, timezone, and rDate/exDate behavior
  • Adds strict option for strict RFC adherence, defaults to false

Testing

  • npm test -- src/tests/rrule-temporal.test.ts

Note

Introduces a toggleable strict RFC 5545 validation and convenience occurrence checks.

  • Adds strict to rule options; enforces RFC 5545 constraints in enforceStrictRfc() (e.g., BYWEEKNO only with FREQ=YEARLY, BYYEARDAY restrictions, BYMONTHDAY not with WEEKLY, numeric BYDAY limits, and requiring BYSETPOS to pair with another BY*). Called from sanitizeOpts(); strict is propagated when parsing ICS.
  • Adds matches(date) (exact-instant occurrence) and occursOn(PlainDate) (day-level check in rule tz). Both leverage between() and respect rDate/exDate.
  • README: documents new strict option and the new API methods; test suite expanded to cover strict errors, helpers’ behavior, and timezone handling.

Written by Cursor Bugbot for commit 8f51deb. This will update automatically on new commits. Configure here.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c86f1189a6

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@ggaabe ggaabe changed the title Add strict RFC 5545 validation option Add matches/occursOn convenience helpers Jan 15, 2026
@ggaabe ggaabe changed the title Add matches/occursOn convenience helpers Add matches/occursOn convenience helpers and Strict RFC enforcement option Jan 15, 2026
@ggaabe ggaabe merged commit e01f737 into main Jan 15, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant