montrose
montrose copied to clipboard
.every(:week, interval: 2) does not interact with on as expected
I've been tinkering with this library and like what I see, though I've either found a bug or don't quite understand the options.
Pattern:
Montrose.every(:week, interval: 2).on(["sunday", "monday"]).between(("2021-05-02".to_time)..("2021-05-22".to_time)).events.to_a
Events:
[2021-05-02, 2021-05-10, 2021-05-16]
The matching dates are the sunday of one week, then the monday of the next week, then the sunday of the week after that
I would expect the dates to be [2021-05-02, 2021-05-03, 2021-05-16, 2021-05-17]
It seems like the library is running a Monday-Sunday week with no option to change this (though Sunday seems to have a day number of 0, which implies a Sunday-Monday week)
Hey @JonPugsley - I just tried that same command into my console, and the results were what you mentioned expecting:
Montrose.every(:week, interval: 2).on(["sunday", "monday"]).between(("2021-05-02".to_time)..("2021-05-22".to_time)).events.to_a
Are you using the most recent version of the gem?

Hi @thewatts I also get the same output as @mikalai-yankouski and @JonPugsley ...
the version is the montrose (0.13.0)