Skip to content

Commit

Permalink
bookableDate fix (gin-gonic#20)
Browse files Browse the repository at this point in the history
bookableDate fix
  • Loading branch information
appleboy authored Sep 24, 2019
2 parents 122cd32 + 3f06e6f commit 0f87af7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion custom-validation/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ func bookableDate(
) bool {
if date, ok := field.Interface().(time.Time); ok {
today := time.Now()
if today.Year() > date.Year() || today.YearDay() > date.YearDay() {
if today.Year() > date.Year() || (today.Year() == date.Year() && today.YearDay() > date.YearDay()) {
return false
}
}
Expand Down

0 comments on commit 0f87af7

Please sign in to comment.