small pixel drawing of a pufferfish vore

clarify published logic, add more date formats
Jes Olson j3s@c3f.net
Sat, 08 Jul 2023 01:43:07 -0500
commit

0fee615ab7f9d95f2565d59bda1d603ad3c6f0f2

parent

c5dfb6a24b368c476b55230dee856d0460ad74fd

2 files changed, 8 insertions(+), 2 deletions(-)

jump to
M rss/atom.gorss/atom.go

@@ -44,8 +44,11 @@

next := new(Item) next.Title = item.Title next.Summary = item.Summary - if item.Date == "" { - item.Date = item.Published + if item.Published != "" { + next.Date, err = parseTime(item.Published) + if err == nil { + next.DateValid = true + } } if item.Date != "" { next.Date, err = parseTime(item.Date)
M rss/time.gorss/time.go

@@ -71,6 +71,9 @@ "Jan 2, 06 15:04 PM -0700 MST",

// j3s additions "2006-01-02T15:04:05-0700", + "2006-01-02", + "02 Jan 2006 15:04:05 Z", + "Mon, 2 Jan 2006 15:04:05 -0700", } func parseTime(s string) (time.Time, error) {