Skip to content

Commit

Permalink
fix time offset not considered
Browse files Browse the repository at this point in the history
  • Loading branch information
evogelsa committed Jan 7, 2021
1 parent 9e83be6 commit c355403
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion miz/miz.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ func parseTime() int {

// get system time in second
t := time.Now()
t.Add(time.Duration(config.HourOffset) * time.Hour)
t = t.Add(config.HourOffset * time.Hour)

return ((t.Hour()*60)+t.Minute())*60 + t.Second()
}
Expand Down
11 changes: 6 additions & 5 deletions util/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package util
import (
"encoding/json"
"os"
"time"
)

// Must performs a lazy error "check"
Expand All @@ -14,11 +15,11 @@ func Must(err error) {

// Configuration is the structure of config.json to be parsed
type Configuration struct {
APIKey string `json:"api-key"`
ICAO string `json:"icao"`
HourOffset int `json:"hour-offset"`
InputFile string `json:"input-mission-file"`
OutputFile string `json:"output-mission-file"`
APIKey string `json:"api-key"`
ICAO string `json:"icao"`
HourOffset time.Duration `json:"hour-offset"`
InputFile string `json:"input-mission-file"`
OutputFile string `json:"output-mission-file"`
}

func ParseConfig() Configuration {
Expand Down

0 comments on commit c355403

Please sign in to comment.