diff --git a/lib/routes/chinafile/index.js b/lib/routes/chinafile/index.js index 0c5fd4cdf8..636316ad84 100644 --- a/lib/routes/chinafile/index.js +++ b/lib/routes/chinafile/index.js @@ -1,6 +1,7 @@ const Parser = require('rss-parser'); const cheerio = require('cheerio'); const got = require('@/utils/got'); +const dayjs = require('dayjs'); module.exports = async (ctx) => { const category = ctx.params.category || 'all'; @@ -40,14 +41,16 @@ module.exports = async (ctx) => { url = $('link[rel="canonical"]').attr('href'); + const pubDate = dayjs(`${item.pubDate.replace(' - ', ' ').replace('am', ' am').replace('pm', ' pm')}`).toISOString(); + return { title: item.title, id: item.guid, - pubDate: item.pubDate, + pubDate, updated: updatedAt, author: item.creator, link: url, - summary: summary, + summary, description: content.html(), category: categories, icon: 'https://www.chinafile.com/sites/default/files/chinafile_favicon.png',