From 527f62722b4a708acf3b9d6fcc7d904558679428 Mon Sep 17 00:00:00 2001 From: "Alexander \"Arav\" Andreev" Date: Sat, 22 Jan 2022 23:20:26 +0400 Subject: [PATCH] RSS pubDate is now in a right format. --- homepage/index.js | 1 + homepage/views/rss.pug | 2 +- shared/util.js | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/homepage/index.js b/homepage/index.js index 7b3c1ed..a81e0e0 100644 --- a/homepage/index.js +++ b/homepage/index.js @@ -141,6 +141,7 @@ const pug = new koaPug({ locals: { date_: (date, tz) => util.datetime(date, util.date_formats.post_date, tz), date_id: (date, tz) => util.datetime(date, util.date_formats.id_date, tz), + date_rss: date => util.datetime(date, util.date_formats.rss_date, "UTC"), rssLink: util.rssLink }, app: app }); diff --git a/homepage/views/rss.pug b/homepage/views/rss.pug index a35c370..dfc3353 100644 --- a/homepage/views/rss.pug +++ b/homepage/views/rss.pug @@ -12,7 +12,7 @@ rss(version='2.0') title= item.title category= item.category guid!= `${item.category.toLowerCase()}-${date_id(item.date, "UTC")}` - pubDate= item.date + pubDate= date_rss(item.date) link!= rssLink(schemahost, item.date, item.category.toLowerCase()) author!= author description diff --git a/shared/util.js b/shared/util.js index 75c756f..ff1d265 100644 --- a/shared/util.js +++ b/shared/util.js @@ -3,6 +3,7 @@ const moment = require("moment-timezone"); const date_formats = Object.freeze({ post_date: "Do MMMM YYYY HH:mm:ss z", file_date: "YYYY-MM-DD HH:mm:ss z", + rss_date: "ddd, DD MMM YYYY HH:mm:ss ZZ", id_date: "YYYYMMDD-HHmm" }); function datetime(date, format=date_formats.post_date, timezone="UTC") {