mirror of
https://github.com/DIYgod/RSSHub.git
synced 2026-09-24 23:12:34 +08:00
fix: invalid date for chinafile (#6117)
This commit is contained in:
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user