floraison / fugit

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

parse_nat with weekday ranges doesn't parse correctly #27

Closed shaicoleman closed 4 years ago

shaicoleman commented 4 years ago
# Parses correctly with days specified individually
puts Fugit.parse_nat('every Fri,Sat,Sun at 18:00 UTC').weekdays.inspect
=> [[0], [5], [6]]

# Parses incorrectly with day ranges spanning the end of week
puts Fugit.parse_nat('every Fri-Sun at 18:00 UTC').weekdays.inspect
=> [[0], [1], [2], [3], [4], [5]]
jmettraux commented 4 years ago

@shaicoleman would it actually hurt you to say thanks for #24 and #25 ?

shaicoleman commented 4 years ago

No, it wouldn't. Thanks for everything, your work is truly appreciated.

jmettraux commented 4 years ago

You're welcome, thanks for the great feedback!

jmettraux commented 4 years ago

I have to fix that as well for cron"0 19 * 11-3 0" and "0 19 * nov-mar 0".

jmettraux commented 4 years ago

Closing, I think I got it covered, I also had a look at the other possible ranges and added specs for them, and fixed the ones that were broken.