REPOSITORY CODING · HARD
Apply recurrence COUNT before exclusions and explicit dates
Excluded occurrences are replaced by later rule dates, and an off-by-one includes an extra candidate. Apply COUNT to the raw rule sequence before inclusion/exclusion set operations, then enforce the exact count.
Repository ImplementationDate recurrence calendar workbench
Work through a real codebase.
Choose an environment, investigate the existing implementation and use the tests to check your change. Sign in to open a workspace; execution and Ono usage follow your plan’s allowances.
Task requirements and environments
Angular · 80 minute session
- Expand a bounded date-only recurrence with DAILY, WEEKLY or MONTHLY frequency and interval 1–12. Dates are strict Gregorian YYYY-MM-DD values in 1900–2100 and calculations use UTC day numbers. The inclusive view range spans at most 3700 days. This deliberately bounded contract is not a complete RFC 5545 implementation.
- Daily intervals are start-relative. Weekly intervals use the Monday containing start, with BYDAY or the start weekday by default. Monthly intervals use the start month, with BYMONTHDAY or the start day by default. Positive invalid month days are skipped; negative positions count backwards from the actual month end.
- Rule candidates must satisfy filters and lie in the view range. COUNT, when supplied, limits that rule candidate sequence before exclusions; excluded candidates still consume COUNT. Explicit include dates do not consume COUNT. This contract does not unconditionally include a start date that fails its rule filters.
- The final dates are the sorted union of rule dates and explicit inclusions, clipped to the view range, with exclusions taking precedence. Deduplicate dates and validate every explicit date, including excluded and out-of-range ones. Requests remain unchanged.
JavaScript · 80 minute session
- Expand a bounded date-only recurrence with DAILY, WEEKLY or MONTHLY frequency and interval 1–12. Dates are strict Gregorian YYYY-MM-DD values in 1900–2100 and calculations use UTC day numbers. The inclusive view range spans at most 3700 days. This deliberately bounded contract is not a complete RFC 5545 implementation.
- Daily intervals are start-relative. Weekly intervals use the Monday containing start, with BYDAY or the start weekday by default. Monthly intervals use the start month, with BYMONTHDAY or the start day by default. Positive invalid month days are skipped; negative positions count backwards from the actual month end.
- Rule candidates must satisfy filters and lie in the view range. COUNT, when supplied, limits that rule candidate sequence before exclusions; excluded candidates still consume COUNT. Explicit include dates do not consume COUNT. This contract does not unconditionally include a start date that fails its rule filters.
- The final dates are the sorted union of rule dates and explicit inclusions, clipped to the view range, with exclusions taking precedence. Deduplicate dates and validate every explicit date, including excluded and out-of-range ones. Requests remain unchanged.