Skip to content

Commit

Permalink
Merge pull request #31 from philodavies/main
Browse files Browse the repository at this point in the history
  • Loading branch information
adhocore authored Jul 27, 2023
2 parents 5a6b134 + ec435a0 commit f878463
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions gronx_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,8 @@ func testcases() []Case {
{"* * * * 5#2", "2011-07-01 00:00:00", false, "2011-07-08 00:00:00"},
{"* * * * 5#1", "2011-07-01 00:00:00", true, "2011-07-01 00:01:00"},
{"* * * * 3#4", "2011-07-01 00:00:00", false, "2011-07-27 00:00:00"},
{"0 0 * * 1#1", "2009-10-23 00:00:00", false, "2009-11-02 00:00:00"},
{"0 0 * * 1#1", "2009-11-23 00:00:00", false, "2009-12-07 00:00:00"},
{"5/0 * * * *", "2021-04-19 12:54:00", false, "2018-08-13 00:25:00"},
{"5/20 * * * *", "2018-08-13 00:24:00", false, "2018-08-13 00:25:00"},
{"5/20 * * * *", "2018-08-13 00:45:00", true, "2018-08-13 01:05:00"},
Expand Down
2 changes: 1 addition & 1 deletion validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,5 +142,5 @@ func isValidWeekDay(val string, last int, ref time.Time) (bool, error) {
return false, nil
}

return ref.Day()/7 == nth-1, nil
return (ref.Day()-1)/7 == nth-1, nil
}

0 comments on commit f878463

Please sign in to comment.