floraison / fugit

time tools (cron, parsing, durations, ...) for Ruby, rufus-scheduler, and flor
MIT License
355 stars 29 forks source link

Fugit::Nat.parse with different times in the same hour not parsed as single cron #29

Closed shaicoleman closed 4 years ago

shaicoleman commented 4 years ago
# When there are different hours, it works correctly
Fugit::Nat.parse('every day at 18:00 and 19:00 UTC').original
=> "0 18,19 * * * UTC"

# When there are different minutes in the same hour, it doesn't
Fugit::Nat.parse('every day at 18:00 and 18:15 UTC').original
=> "0 18 * * * UTC" # should be: "0,15 18 * * * UTC"

# More complex example (but possibly difficult to implement)
Fugit::Nat.parse('every day at 18:00 and 18:15 and 19:00 and 19:15 UTC').original
=> "0 18 * * * UTC" # should be: "0,15 18,19 * * * UTC"

Thanks again

jmettraux commented 4 years ago

Thanks a lot!

jmettraux commented 4 years ago

I'm closing this issue. Please tell me if you spot any further issue.

The fix is included in the 1.3.1 release I've just pushed.

Many thanks for discovering all those cases, it's much appreciated!