Add pause until, store as unix second, to disable a user for a time

This commit is contained in:
Bel LaPointe
2022-01-11 23:11:42 -05:00
parent 9840be93f6
commit 4ffc6bba8c
5 changed files with 59 additions and 2 deletions

23
config/time.go Normal file
View File

@@ -0,0 +1,23 @@
package config
import (
"encoding/json"
"time"
)
type Time time.Time
func (t Time) Get() time.Time {
return time.Time(t)
}
func (t Time) MarshalJSON() ([]byte, error) {
return json.Marshal(t.Get().Unix())
}
func (t *Time) UnmarshalJSON(b []byte) error {
var d int64
err := json.Unmarshal(b, &d)
*t = Time(time.Unix(d, 0))
return err
}