Implement destinations

This commit is contained in:
nemunaire 2022-10-23 00:56:24 +02:00
commit a0659dd9bd
3 changed files with 210 additions and 43 deletions

17
api/time.go Normal file
View file

@ -0,0 +1,17 @@
package api
import (
"time"
)
type IDFMTime time.Time
func (t *IDFMTime) UnmarshalJSON(b []byte) error {
tmp, err := time.Parse("\"2006-01-02T15:04\"", string(b))
*t = IDFMTime(tmp)
return err
}
func (t IDFMTime) MarshalJSON() ([]byte, error) {
return []byte(time.Time(t).Format("\"2006-01-02T15:04\"")), nil
}