Implement destinations
This commit is contained in:
parent
c458a32d7b
commit
a0659dd9bd
3 changed files with 210 additions and 43 deletions
17
api/time.go
Normal file
17
api/time.go
Normal 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
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue