Skip to content

Commit

Permalink
use four-digit years for RSS pubDate (#3907)
Browse files Browse the repository at this point in the history
  • Loading branch information
bnewbold authored May 8, 2024
1 parent 38198fd commit f3515e2
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions bskyweb/cmd/bskyweb/rss.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,16 @@ import (
"fmt"
"net/http"
"strings"
"time"

appbsky "github.com/bluesky-social/indigo/api/bsky"
"github.com/bluesky-social/indigo/atproto/syntax"

"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"`
Expand Down Expand Up @@ -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()),
Expand Down

0 comments on commit f3515e2

Please sign in to comment.