Booking
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package ocss
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"time"
|
||||
)
|
||||
@@ -31,6 +32,22 @@ func (t JSONTime) MarshalJSON() ([]byte, error) {
|
||||
return []byte(stamp), nil
|
||||
}
|
||||
|
||||
func (t *JSONTime) UnmarshalJSON(b []byte) error {
|
||||
var timestamp int64
|
||||
err := json.Unmarshal(b, ×tamp)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
parsed := time.Unix(timestamp, 0)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
jsontime := JSONTime(parsed)
|
||||
*t = jsontime
|
||||
return nil
|
||||
}
|
||||
|
||||
type JourneySchedule struct {
|
||||
ID *string `json:"id,omitempty"`
|
||||
PassengerPickupDate JSONTime `json:"passengerPickupDate"`
|
||||
|
||||
Reference in New Issue
Block a user