diff --git a/broker/ntgvision.go b/broker/ntgvision.go index 746f8ec..782c046 100644 --- a/broker/ntgvision.go +++ b/broker/ntgvision.go @@ -223,11 +223,7 @@ func (ntg NTGVision) SearchZips(zips []string) ([]Job, error) { func (ntg NTGVision) workingHours(now time.Time) bool { // TODO assert M-F 9-4 EST - location, err := time.LoadLocation("EST") - if err != nil { - panic(err) - } - now = now.In(location) + now = now.In(time.FixedZone("EST", -5*60*60)) switch now.Weekday() { case time.Sunday, time.Saturday: return false diff --git a/broker/ntgvision_test.go b/broker/ntgvision_test.go index cbbe260..92119de 100644 --- a/broker/ntgvision_test.go +++ b/broker/ntgvision_test.go @@ -7,10 +7,10 @@ import ( func TestWorkingHoursNTG(t *testing.T) { ntg := NTGVision{} - if !ntg.workingHours(time.Date(2022, 1, 27, 12, 0, 0, 0, time.Local)) { + if !ntg.workingHours(time.Date(2022, 1, 27, 12, 0, 0, 0, time.FixedZone("MST", -7*60*60))) { t.Fatal("noon MST not ok") } - if ntg.workingHours(time.Date(2022, 1, 27, 23, 0, 0, 0, time.Local)) { + if ntg.workingHours(time.Date(2022, 1, 27, 23, 0, 0, 0, time.FixedZone("MST", -7*60*60))) { t.Fatal("midnight MST ok") } }