RSS pubDate is now in a right format.
This commit is contained in:
parent
b30b85fb72
commit
527f62722b
@ -141,6 +141,7 @@ const pug = new koaPug({
|
|||||||
locals: {
|
locals: {
|
||||||
date_: (date, tz) => util.datetime(date, util.date_formats.post_date, tz),
|
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_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 },
|
rssLink: util.rssLink },
|
||||||
app: app
|
app: app
|
||||||
});
|
});
|
||||||
|
@ -12,7 +12,7 @@ rss(version='2.0')
|
|||||||
title= item.title
|
title= item.title
|
||||||
category= item.category
|
category= item.category
|
||||||
guid!= `${item.category.toLowerCase()}-${date_id(item.date, "UTC")}`
|
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())
|
link!= rssLink(schemahost, item.date, item.category.toLowerCase())
|
||||||
author!= author
|
author!= author
|
||||||
description
|
description
|
||||||
|
@ -3,6 +3,7 @@ const moment = require("moment-timezone");
|
|||||||
const date_formats = Object.freeze({
|
const date_formats = Object.freeze({
|
||||||
post_date: "Do MMMM YYYY HH:mm:ss z",
|
post_date: "Do MMMM YYYY HH:mm:ss z",
|
||||||
file_date: "YYYY-MM-DD 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" });
|
id_date: "YYYYMMDD-HHmm" });
|
||||||
|
|
||||||
function datetime(date, format=date_formats.post_date, timezone="UTC") {
|
function datetime(date, format=date_formats.post_date, timezone="UTC") {
|
||||||
|
Loading…
Reference in New Issue
Block a user