-
Notifications
You must be signed in to change notification settings - Fork 24
Open
Description
Currently if one tries to call #next it only throws a StopIteration error.
It would be nice to know if the until field is in the past for a safe catch.
Example:
Running via Spring preloader in process 25488
Loading development environment (Rails 6.1.3.1)
irb(main):001:0> str = "FREQ=DAILY;UNTIL=20210818T121000Z;COUNT=30;INTERVAL=1;WKST=MO"
irb(main):002:0> rrule = RRule.parse str
irb(main):003:0> rrule
=> #<RRule::Rule:0x00007fe920a96788 @tz="UTC", @dtstart=Thu, 19 Aug 2021 17:10:39.000000000 UTC +00:00, @exdate=[], @options={:interval=>1, :wkst=>1, :freq=>"DAILY", :until=>2021-08-18 12:10:00 UTC, :count=>30, :timeset=>[{:hour=>17, :minute=>10, :second=>39}]}, @frequency_type=RRule::Daily, @max_year=9999, @max_date=Fri, 01 Jan 9999 00:00:00 +0000>
irb(main):004:0> rrule.next
Traceback (most recent call last):
1: from (irb):4
StopIteration (iteration reached an end)
irb(main):005:0>Metadata
Metadata
Assignees
Labels
No labels