jkbrzt / rrule

JavaScript library for working with recurrence rules for calendar dates as defined in the iCalendar RFC and more.
https://jkbrzt.github.io/rrule
Other
3.27k stars 507 forks source link

Incorrect return type for RRule.after #560

Open jkepps opened 1 year ago

jkepps commented 1 year ago

RRule.after docs say that it returns Date or null, but the function definition specifies only Date. The function will return null if there are no dates in the recurrence after the given parameter, so the function does indeed return Date or null. The function definition should be updated to specify the correct return type.

The repro steps are fairly straightforward. Instantiate a new rrule object with a recurrence in the past. Invoke the after method with a date that's in the future. The function will return null.