diff --git a/def.go b/def.go index 0634494..ed1a852 100644 --- a/def.go +++ b/def.go @@ -126,9 +126,9 @@ func fromChatWarsDate(d string) (t time.Time, err error) { t, _ := time.Parse(time.RFC3339, "2018-01-31T00:00:00+00:00") t = t.AddDate(0, 0, (days / 3)) - t = t.Add(time.Hour * ((days % 3) * 8)) - t = t.Add(time.Minute * (hour * 20)) - t = t.Add(time.Second * (minute * 20)) + t = t.Add(time.Hour * time.Duration(days%3) * 8) + t = t.Add(time.Minute * time.Duration(hour) * 20) + t = t.Add(time.Second * time.Duration(minute) * 20) return t, nil } else { return time.Now(), errors.New("Wrong format")