use ts for tses, including in schedule

master
Bel LaPointe 2021-12-31 16:16:22 -05:00
parent 106a6bd783
commit a4cfc77e0a
2 changed files with 5 additions and 1 deletions

View File

@ -86,5 +86,5 @@ type scheduleDue int64
var scheduleDuePattern = regexp.MustCompile(`^[0-9]+$`)
func (due scheduleDue) next(time.Time) (time.Time, error) {
return time.Unix(int64(due), 0), nil
return TS(due).time(), nil
}

View File

@ -7,6 +7,10 @@ import (
type TS int64
func (ts TS) time() time.Time {
return time.Unix(int64(ts), 0)
}
func (ts TS) MarshalJSON() ([]byte, error) {
v, err := ts.MarshalYAML()
if err != nil {