From f3515e2673a36b031ed0286b0aa547ac8657cc96 Mon Sep 17 00:00:00 2001 From: bnewbold Date: Wed, 8 May 2024 09:33:38 -0700 Subject: [PATCH] use four-digit years for RSS pubDate (#3907) --- bskyweb/cmd/bskyweb/rss.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/bskyweb/cmd/bskyweb/rss.go b/bskyweb/cmd/bskyweb/rss.go index 76689abb51..204cb26a83 100644 --- a/bskyweb/cmd/bskyweb/rss.go +++ b/bskyweb/cmd/bskyweb/rss.go @@ -5,7 +5,6 @@ import ( "fmt" "net/http" "strings" - "time" appbsky "github.com/bluesky-social/indigo/api/bsky" "github.com/bluesky-social/indigo/atproto/syntax" @@ -13,6 +12,9 @@ import ( "github.com/labstack/echo/v4" ) +// time.RFC822Z, but with four digit year. used for RSS pubData. +var FullYearRFC822Z = "02 Jan 2006 15:04 -0700" + type ItemGUID struct { XMLName xml.Name `xml:"guid"` Value string `xml:",chardata"` @@ -107,7 +109,7 @@ func (srv *Server) WebProfileRSS(c echo.Context) error { pubDate := "" createdAt, err := syntax.ParseDatetimeLenient(rec.CreatedAt) if nil == err { - pubDate = createdAt.Time().Format(time.RFC822Z) + pubDate = createdAt.Time().Format(FullYearRFC822Z) } posts = append(posts, Item{ Link: fmt.Sprintf("https://%s/profile/%s/post/%s", req.Host, pv.Handle, aturi.RecordKey().String()),