Browse Source

Merge branch 'asmodeus' of git.aiterp.net:lucifer/new-server into asmodeus

feature-colorvalue2 3.1.0
Stian Fredrik Aune 3 years ago
parent
commit
d91bd472dd
  1. 2
      models/timeofday.go
  2. 2
      models/timeofday_test.go

2
models/timeofday.go

@ -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
models/timeofday_test.go

@ -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 {

Loading…
Cancel
Save