Ensure all dates returned are ISO8601
This commit is contained in:
@@ -1,16 +1,15 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/rs/zerolog"
|
||||
"time"
|
||||
)
|
||||
|
||||
type Message struct {
|
||||
Text string `json:"text"`
|
||||
Guid string `json:"guid"`
|
||||
Sender *string `json:"sender,omitempty"` // Optional: nil means from "me"
|
||||
Date time.Time `json:"date"`
|
||||
Text string `json:"text"`
|
||||
Guid string `json:"guid"`
|
||||
Sender *string `json:"sender,omitempty"` // Optional: nil means from "me"
|
||||
Date Date `json:"date"`
|
||||
|
||||
// Map of attachment GUID to attachment metadata
|
||||
Attachments *map[string]AttributionInfo `json:"attachmentMetadata,omitempty"` // Optional
|
||||
@@ -24,7 +23,7 @@ type AttributionInfo struct {
|
||||
func (c Message) MarshalZerologObject(e *zerolog.Event) {
|
||||
e.Str("guid", c.Guid)
|
||||
e.Str("text", c.Text)
|
||||
e.Time("date", c.Date)
|
||||
e.Time("date", time.Time(c.Date))
|
||||
|
||||
if c.Sender != nil {
|
||||
e.Str("sender", *c.Sender)
|
||||
|
||||
Reference in New Issue
Block a user