]> Sergey Matveev's repositories - sgblog.git/blobdiff - cmd/sgblog/http.go
ISO compatible, Atom-required, dates in comments feed
[sgblog.git] / cmd / sgblog / http.go
index 7ed1ea6e33219ded65715e5f8524d166a8f6d3c8..02237353366459d2fc20550fa27c22721c54814b 100644 (file)
@@ -645,8 +645,8 @@ func serveHTTP() {
                                                commit.Hash.String(), "#comment", commentN,
                                        }, ""),
                                }},
-                               Published: atom.TimeStr(date),
-                               Updated:   atom.TimeStr(date),
+                               Published: atom.TimeStr(strings.Replace(date, " ", "T", -1)),
+                               Updated:   atom.TimeStr(strings.Replace(date, " ", "T", -1)),
                                Content: &atom.Text{
                                        Type: "html",
                                        Body: strings.Join(htmlized, "\n"),
@@ -747,8 +747,12 @@ func serveHTTP() {
                                                        "#comment", comment.n,
                                                }, ""),
                                        }},
-                                       Published: atom.TimeStr(comment.date),
-                                       Updated:   atom.TimeStr(comment.date),
+                                       Published: atom.TimeStr(
+                                               strings.Replace(comment.date, " ", "T", -1),
+                                       ),
+                                       Updated: atom.TimeStr(
+                                               strings.Replace(comment.date, " ", "T", -1),
+                                       ),
                                        Content: &atom.Text{
                                                Type: "html",
                                                Body: strings.Join(htmlized, "\n"),