diff --git a/time.go b/time.go index 671e145..e299b88 100644 --- a/time.go +++ b/time.go @@ -75,6 +75,9 @@ func (t Time) After(tm Time) bool { if t.Hour > tm.Hour { return true } + if t.Hour < tm.Hour{ + return false + } return t.Minute > tm.Minute } diff --git a/time_test.go b/time_test.go index 7ddd258..041645d 100644 --- a/time_test.go +++ b/time_test.go @@ -114,6 +114,12 @@ func TestAfter(t *testing.T) { t2: Time{23, 59, true}, isAfter: false, }, + { + name: "Before", + t1: Time{11, 59, true}, + t2: Time{23, 59, true}, + isAfter: false, + }, } for _, tt := range cases { t.Run(tt.name, func(t *testing.T) {