ice-cube-ruby / ice_cube

Ruby Date Recurrence Library - Allows easy creation of recurrence rules and fast querying
MIT License
2.41k stars 358 forks source link

Possible to handle RRules that only include the 'until' clause? #517

Closed JeremiahChurch closed 2 years ago

JeremiahChurch commented 2 years ago

Exchange server likes to create recurrence rules that only include 'until' in the rules.

Example: RRULE:UNTIL=20221206T050000Z;

Right now ice_cube returns an ArgumentError when that is passed in IceCube::Schedule.from_ical 'RRULE:UNTIL=20221206T050000Z;' => ArgumentError (Invalid rule type)

Would it be possible for ice_cube to handle these rather than raise?

pacso commented 2 years ago

Can you provide an example of the full schedule that you're trying to parse?

JeremiahChurch commented 2 years ago

Can you provide an example of the full schedule that you're trying to parse?

Hi @pacso - certainly! the example in my initial post is a complete rule returned by exchange: RRULE:UNTIL=20221206T050000Z;

pacso commented 2 years ago

Well, this doesn't seem right. Ignoring both this gem and Exchange for a moment, if I told you to "put a schedule in your diary until 6th December 2022" ... what exactly would you do? Weekly entries ... on some random day of the week? Something monthly? Daily perhaps?

It doesn't really make sense.

What schedule are you expecting to be created from that rule?