fix: remove pubDate due to i18n date string parsing issue (#2144)

This commit is contained in:
Henry Wang 2019-05-16 04:17:57 +01:00 committed by DIYgod
parent 6e0e993fc6
commit 770a094414
1 changed files with 8 additions and 8 deletions

View File

@ -25,13 +25,13 @@ module.exports = async (ctx) => {
.map((i, e) => $(e).text())
.get();
const datelist = $('tr td p')
.map((i, e) =>
$(e)
.text()
.trim()
)
.get();
// const datelist = $('tr td p')
// .map((i, e) =>
// $(e)
// .text()
// .trim()
// )
// .get();
const out = await Promise.all(
list.map(async (itemUrl, index) => {
@ -54,7 +54,7 @@ module.exports = async (ctx) => {
link: itemUrl,
author: 'Apple Inc.',
description: description,
pubDate: new Date(datelist[index].replace(/(\d+) 年 (\d+) 月 (\d+) 日/, '$1-$2-$3')).toISOString(),
// pubDate: new Date(datelist[index].replace(/(\d+) 年 (\d+) 月 (\d+) 日/, '$1-$2-$3')).toISOString(),
};
ctx.cache.set(itemUrl, JSON.stringify(single));