This commit is contained in:
Paul Kirby 2018-12-20 16:32:30 +00:00 committed by GitHub
commit 71b6946cef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 0 deletions

View File

@ -319,6 +319,10 @@ func (expr *Expression) dowFieldHandler(s string) error {
case one:
populateOne(expr.daysOfWeek, directive.first)
case span:
// To properly handle spans that end in 7 (Sunday)
if directive.last == 0 {
directive.last = 6
}
populateMany(expr.daysOfWeek, directive.first, directive.last, directive.step)
case all:
populateMany(expr.daysOfWeek, directive.first, directive.last, directive.step)

View File

@ -139,6 +139,15 @@ var crontests = []crontest{
{"2013-12-30 00:30:00", "Sat 2014-01-04 00:00"},
},
},
{
"0 0 * * 5-7",
"Mon 2006-01-02 15:04",
[]crontimes{
{"2013-01-01 00:00:00", "Fri 2013-01-04 00:00"},
{"2013-01-28 00:00:00", "Fri 2013-02-01 00:00"},
{"2013-12-30 00:30:00", "Fri 2014-01-03 00:00"},
},
},
// Specific days of week
{