Merge branch 'asmodeus' of git.aiterp.net:lucifer/new-server into asmodeus
continuous-integration/drone/push Build is failing
continuous-integration/drone Build is passing
continuous-integration/drone/tag Build is passing

This commit is contained in:
Stian Fredrik Aune
2021-10-03 19:10:06 +02:00
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 { func CurrentTimeOfDay() TimeOfDay {
return TimeOfDayFromDate(time.Now()) return TimeOfDayFromDate(time.Now().Local())
} }
func TimeOfDayFromDate(date time.Time) TimeOfDay { 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("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:00"), false },
{ tod("16:14:43"), tod("15:30"), tod("16:15"), true }, { 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 { for i, row := range table {