Commit ce99543
Update to BYSETPOS support (#449)
* 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 <[email protected]>
Co-authored-by: Jon Pascoe <[email protected]>1 parent 83144a5 commit ce99543
File tree
32 files changed
+1968
-26
lines changed- lib
- ice_cube
- parsers
- rules
- validations
- spec/examples
32 files changed
+1968
-26
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
8 | 11 | | |
9 | 12 | | |
10 | 13 | | |
11 | | - | |
12 | 14 | | |
13 | 15 | | |
14 | 16 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
253 | 253 | | |
254 | 254 | | |
255 | 255 | | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
256 | 281 | | |
257 | 282 | | |
258 | 283 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
53 | 62 | | |
54 | 63 | | |
55 | 64 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
| 88 | + | |
| 89 | + | |
93 | 90 | | |
94 | 91 | | |
95 | 92 | | |
| |||
98 | 95 | | |
99 | 96 | | |
100 | 97 | | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
101 | 111 | | |
102 | 112 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
5 | 8 | | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
6 | 17 | | |
7 | 18 | | |
8 | 19 | | |
| |||
75 | 86 | | |
76 | 87 | | |
77 | 88 | | |
78 | | - | |
| 89 | + | |
79 | 90 | | |
80 | 91 | | |
81 | 92 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
52 | | - | |
| 52 | + | |
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
56 | | - | |
| 56 | + | |
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
| |||
0 commit comments