fix(route): zhihu posts pubDate (#8947)

This commit is contained in:
cjc7373
2022-02-02 22:53:56 +08:00
committed by GitHub
parent 7fd870ef8f
commit 96270cd1cc
+2 -1
View File
@@ -1,6 +1,7 @@
const got = require('@/utils/got');
const utils = require('./utils');
const cheerio = require('cheerio');
const { parseDate } = require('@/utils/parse-date');
module.exports = async (ctx) => {
const id = ctx.params.id;
@@ -38,7 +39,7 @@ module.exports = async (ctx) => {
title: String(item.title),
description: item.content,
link: item.url,
pubDate: new Date(item.updated).toUTCString(),
pubDate: parseDate(item.updated * 1000),
})),
};
};