rossta / montrose

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

Possible to have occurrences at different times on different days? #111

Closed adambedford closed 5 years ago

adambedford commented 5 years ago

Is it possible to configure a series to have occurrences at different times on different days? e.g. a single Recurrence with events every week on Tuesday at 6pm and Thursday at 8pm?

rossta commented 5 years ago

Currently, the way to do this would be to build a schedule of multiple recurrences and enumerate the merged results:

https://github.com/rossta/montrose/blob/91af7d2d5c337aa255510179d24eb023775674bb/lib/montrose/schedule.rb#L13-L28

https://github.com/rossta/montrose/blob/91af7d2d5c337aa255510179d24eb023775674bb/lib/montrose/schedule.rb#L62-L70

adambedford commented 5 years ago

Thank you for the guidance. Will this still play nicely with to_h and marshaling the recurrence to a DB field?

On Mon, Mar 25, 2019 at 12:39 PM Ross Kaffenberger notifications@github.com wrote:

Currently, the way to do this would be to build a schedule of multiple recurrences and enumerate the merged results:

https://github.com/rossta/montrose/blob/91af7d2d5c337aa255510179d24eb023775674bb/lib/montrose/schedule.rb#L13-L28

https://github.com/rossta/montrose/blob/91af7d2d5c337aa255510179d24eb023775674bb/lib/montrose/schedule.rb#L62-L70

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/rossta/montrose/issues/111#issuecomment-476347624, or mute the thread https://github.com/notifications/unsubscribe-auth/ABjQOQNyIwfyorM3iwIRr61oHv6t7Bqrks5vaSYCgaJpZM4cF1c2 .

rossta commented 5 years ago

Not currently but I'd welcome patches to add support for those features!

rossta commented 5 years ago

Added support for Schedule#load and Schedule#dump in 0.10.1