add another test and fix local.
continuous-integration/drone/push Build is failing

This commit is contained in:
2021-10-03 18:35:04 +02:00
parent ad2f912a6f
commit ade49589a9
2 changed files with 3 additions and 1 deletions
+1 -1
View File
@@ -82,7 +82,7 @@ func (t TimeOfDay) IsBetween(from TimeOfDay, to TimeOfDay) bool {
}
func CurrentTimeOfDay() TimeOfDay {
return TimeOfDayFromDate(time.Now())
return TimeOfDayFromDate(time.Now().Local())
}
func TimeOfDayFromDate(date time.Time) TimeOfDay {
+2
View File
@@ -27,6 +27,8 @@ func TestTimeOfDay_IsBetween(t *testing.T) {
{ tod("04:13:57"), tod("21:30"), tod("07"), true },
{ tod("16:14:43"), tod("15:30"), tod("16:00"), false },
{ tod("16:14:43"), tod("15:30"), tod("16:15"), true },
{ tod("08:45:43"), tod("07:00:00"), tod("21:30:00"), true },
{ tod("07:00:00"), tod("07:00:00"), tod("21:30:00"), true },
}
for i, row := range table {