rossta / montrose

Recurring events library for Ruby. Enumerable recurrence objects and convenient chainable interface.
https://rossta.net/montrose/
MIT License
842 stars 52 forks source link

Add Montrose.covering to disambiguate Montrose.between behavior #136

Closed rossta closed 3 years ago

rossta commented 3 years ago

Breaking change

Previous, Montrose.between acted as both a convenience for starts and ùntil as well as providing "masking" behavior to address a feature request. This created some ambiguous behavior and compromised chaining, as noted in #131.

This PR addresses the ambiguity by introducing a new option, :covering to provide the masking behavior without affecting :starts and :until. The :between option will now be used solely as a shorthand for :starts and :until and will be normalized as suggested in #131.

A temporary setting can be used to retain the legacy behavior of :between to assist with the upgrade, e.g. update settings in serialized Recurrences in a database:

Montrose.enable_deprecated_between_masking = true

This setting will be removed in future v1.0.

Fixes #131