diff --git a/models.go b/models.go index fdac7a8..c481a3d 100644 --- a/models.go +++ b/models.go @@ -5,18 +5,20 @@ import ( ) type Article struct { - Title string `json:"title"` - Description string `json:"description"` - Link string `json:"link"` - Published time.Time `json:"published"` // When we first saw the article - OriginalDate time.Time `json:"originalDate"` // Original publication date from the feed - Source string `json:"source"` - FirstSeen time.Time `json:"firstseen"` - Seen time.Time `json:"seen"` - Summary string `json:"summary"` - Importance int `json:"importance"` - ID string `json:"id"` - BroadcastTime time.Time `json:"broadcastTime,omitempty"` + Title string `json:"title"` + Description string `json:"description"` + Link string `json:"link"` + Published time.Time `json:"published"` // When we first saw the article + OriginalDate time.Time `json:"originalDate"` // Original publication date from the feed + Source string `json:"source"` + FirstSeen time.Time `json:"firstseen"` + Seen time.Time `json:"seen"` + Summary string `json:"summary"` + Importance int `json:"importance"` + ID string `json:"id"` + BroadcastTime time.Time `json:"broadcastTime,omitempty"` + RelativeTime string `json:"-"` // Relative time for FirstSeen (calculated field, not stored) + BroadcastRelativeTime string `json:"-"` // Relative time for BroadcastTime (calculated field, not stored) } type LogEntry struct { diff --git a/templates/index.html b/templates/index.html index 1c4698b..3d0a06b 100644 --- a/templates/index.html +++ b/templates/index.html @@ -235,7 +235,7 @@