Skip to content

Conversation

@NicolasMarlier
Copy link

Self-explanatory ;)

@avit
Copy link
Collaborator

avit commented Mar 20, 2017

Interesting! This option doesn't seem to be clearly documented in the icalendar RFC but it looks like it's widely supported by different tools. I believe it would be worth finishing this up and adding it.

http://www.kanzaki.com/docs/ical/recur.html

@avit avit added the feature label Mar 31, 2017
@seejohnrun seejohnrun self-requested a review April 30, 2018 13:55
nehresma added a commit to nehresma/ice_cube that referenced this pull request Jul 30, 2018
A few small updates to Nicolas Marlier's BYSETPOS support added in
PR ice-cube-ruby#349
joshbeckman added a commit to officeluv/ice_cube that referenced this pull request Feb 5, 2019
In August 2016, @NicolasMarlier added BYSETPOS support (ice-cube-ruby#349).

Then, in July 2018, @nehresma added a few small changes to run in modern
Ruby and a more modern rspec
(ice-cube-ruby#449).

Then, in January 2019, @davidstosik and @k3rni suggested changes to
reduce complexity.

This incorporates all the above into a single diff.
davidstosik pushed a commit to davidstosik/ice_cube that referenced this pull request Feb 6, 2019
A few small updates to Nicolas Marlier's BYSETPOS support added in
PR ice-cube-ruby#349
nehresma added a commit to nehresma/ice_cube that referenced this pull request Dec 12, 2022
A few small updates to Nicolas Marlier's BYSETPOS support added in
PR ice-cube-ruby#349
afrase pushed a commit to sessions-inc/ice_cube that referenced this pull request Feb 12, 2025
A few small updates to Nicolas Marlier's BYSETPOS support added in
PR ice-cube-ruby#349
nehresma added a commit to nehresma/ice_cube that referenced this pull request Dec 20, 2025
A few small updates to Nicolas Marlier's BYSETPOS support added in
PR ice-cube-ruby#349
pacso added a commit that referenced this pull request Jan 19, 2026
* Support BYSETPOS for MONTHLY AND YEARLY freq

* Modernize BYSETPOS commit

A few small updates to Nicolas Marlier's BYSETPOS support added in
PR #349

* address the spec DST sensitivity in .to_yaml round trips

* update PR from feedback

rebased against master -- its been 4 years

* excluding until, not util

* remove no longer needed TimeUtil active_support require

This was a holdover from the original PR back in 2016.  TimeUtil
has since been refactored to not need this, but the require was
inadvertently left.

* fix interval use with bysetpos

* remove unneeded use of activesupport for date arithmetic

* support for bysetpos with freq=weekly

* support for parsing rrules from ical that are very long and wrap

* dont require the wrapped line to be the last the ical string

* nitpick fixes - use map and double quotes for consistency

* do not rely on ActiveSupport-only helper methods

* fix BYSETPOS serialization

* fix SETBYPOS with non BYDAY expansions

* expand BYSETPOS spec coverage

- weekly: positive/multi/mixed positions, BYHOUR expansion
- monthly: negative positions, BYMONTHDAY, BYMINUTE
- yearly: multiple positive/negative positions

* adding BYSETPOS validations for daily/hourly/minutely

* add verification that bysetpos runs after other byXXX filters

* BYSETPOS interval boundaries specs

* dd BYSETPOS ordering specs

* add BYSETPOS anchor and interval specs

* refactor and create BYSETPOS helper for interval bounds

* adding more comprehensive BYSETPOS specs

This covers repeated values, out-of-range, and UNTIL cases

* updating readme with bysetpos support

* adding BYSETPOS to_ical spec coverage

* adding SECONDLY BYSETPOS support and specs

* adding BYYEARDAY BYSETPOS specs

* Gemfile adjustments for Ruby stdlib changes

* adding support for more versions of ActiveSupport

* Fix BYSETPOS to count positions from interval start per RFC 5545

BYSETPOS was anchoring candidate enumeration to DTSTART instead of the
interval boundary, causing positions to be miscounted. This skipped the
first occurrence when DTSTART itself matched a BYSETPOS position (e.g.,
starting on the 2nd Tuesday when selecting BYSETPOS=2).

The fix anchors the temporary schedule to the interval start based on
which BYxxx components expand the candidate set (day, month, hour, etc.).

* Fix flaky YAML round-trip test that failed across DST boundaries

Use UTC instead of Time.now to avoid DST offset mismatches when YAML
serialization loses timezone info and preserves only the numeric offset.

* linting fixes

* CHANGELOG entry

* Fix lint errors

* Add missing round-trip YAML tests for BYSETPOS

* Create time objects correctly

* Add edge cases for BYSETPOS

---------

Co-authored-by: Nicolas Marlier <nicolas@juliedesk.com>
Co-authored-by: Jon Pascoe <jon.pascoe@me.com>
@pacso
Copy link
Collaborator

pacso commented Jan 20, 2026

I believe this was implemented in #449

@pacso pacso closed this Jan 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants