Skip to content

Commit 30e5c6f

Browse files
committed
Merge pull request #28 from netroby/master
[bug] Change RSS time format to RFC1123Z for W3C validator
2 parents 2761c77 + 0b6cae5 commit 30e5c6f

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

feed_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,38 +65,38 @@ var rssOutput = `<?xml version="1.0" encoding="UTF-8"?><rss version="2.0">
6565
<description>discussion about tech, footie, photos</description>
6666
<copyright>This work is copyright © Benjamin Button</copyright>
6767
<managingEditor>[email protected] (Jason Moiron)</managingEditor>
68-
<pubDate>16 Jan 13 21:52 EST</pubDate>
68+
<pubDate>Wed, 16 Jan 2013 21:52:35 -0500</pubDate>
6969
<item>
7070
<title>Limiting Concurrency in Go</title>
7171
<link>http://jmoiron.net/blog/limiting-concurrency-in-go/</link>
7272
<description>A discussion on controlled parallelism in golang</description>
7373
<author>Jason Moiron</author>
74-
<pubDate>16 Jan 13 21:52 EST</pubDate>
74+
<pubDate>Wed, 16 Jan 2013 21:52:35 -0500</pubDate>
7575
</item>
7676
<item>
7777
<title>Logic-less Template Redux</title>
7878
<link>http://jmoiron.net/blog/logicless-template-redux/</link>
7979
<description>More thoughts on logicless templates</description>
80-
<pubDate>16 Jan 13 21:52 EST</pubDate>
80+
<pubDate>Wed, 16 Jan 2013 21:52:35 -0500</pubDate>
8181
</item>
8282
<item>
8383
<title>Idiomatic Code Reuse in Go</title>
8484
<link>http://jmoiron.net/blog/idiomatic-code-reuse-in-go/</link>
8585
<description>How to use interfaces &lt;em&gt;effectively&lt;/em&gt;</description>
86-
<pubDate>16 Jan 13 21:52 EST</pubDate>
86+
<pubDate>Wed, 16 Jan 2013 21:52:35 -0500</pubDate>
8787
</item>
8888
<item>
8989
<title>Never Gonna Give You Up Mp3</title>
9090
<link>http://example.com/RickRoll.mp3</link>
9191
<description>Never gonna give you up - Never gonna let you down.</description>
9292
<enclosure url="http://example.com/RickRoll.mp3" length="123456" type="audio/mpeg"></enclosure>
93-
<pubDate>16 Jan 13 21:52 EST</pubDate>
93+
<pubDate>Wed, 16 Jan 2013 21:52:35 -0500</pubDate>
9494
</item>
9595
<item>
9696
<title>String formatting in Go</title>
9797
<link>http://example.com/strings</link>
9898
<description>How to use things like %s, %v, %d, etc.</description>
99-
<pubDate>16 Jan 13 21:52 EST</pubDate>
99+
<pubDate>Wed, 16 Jan 2013 21:52:35 -0500</pubDate>
100100
</item>
101101
</channel>
102102
</rss>`

rss.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ func newRssItem(i *Item) *RssItem {
9292
Link: i.Link.Href,
9393
Description: i.Description,
9494
Guid: i.Id,
95-
PubDate: anyTimeFormat(time.RFC822, i.Created, i.Updated),
95+
PubDate: anyTimeFormat(time.RFC1123Z, i.Created, i.Updated),
9696
}
9797

9898
intLength, err := strconv.ParseInt(i.Link.Length, 10, 64)
@@ -108,8 +108,8 @@ func newRssItem(i *Item) *RssItem {
108108

109109
// create a new RssFeed with a generic Feed struct's data
110110
func (r *Rss) RssFeed() *RssFeed {
111-
pub := anyTimeFormat(time.RFC822, r.Created, r.Updated)
112-
build := anyTimeFormat(time.RFC822, r.Updated)
111+
pub := anyTimeFormat(time.RFC1123Z, r.Created, r.Updated)
112+
build := anyTimeFormat(time.RFC1123Z, r.Updated)
113113
author := ""
114114
if r.Author != nil {
115115
author = r.Author.Email

0 commit comments

Comments
 (0)