From 57d5370109347ec0e63a860e63c7ad2b48e82f0f Mon Sep 17 00:00:00 2001 From: Ethan Shen <42264778+nczitzk@users.noreply.github.com> Date: Sun, 21 Aug 2022 05:14:38 +0800 Subject: [PATCH] =?UTF-8?q?fix(route):=20=E6=97=A5=E6=9C=AC=E7=BB=8F?= =?UTF-8?q?=E6=B5=8E=E6=96=B0=E9=97=BB=E4=B8=AD=E6=96=87=E7=89=88=20(#1055?= =?UTF-8?q?6)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix(route): 日本经济新闻中文版 * fix typo --- lib/v2/nikkei-cn/index.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/v2/nikkei-cn/index.js b/lib/v2/nikkei-cn/index.js index 37db64201..412b9f48c 100644 --- a/lib/v2/nikkei-cn/index.js +++ b/lib/v2/nikkei-cn/index.js @@ -14,7 +14,10 @@ const cleanContent = (language, content) => { } }; -const getPubDate = (link) => timezone(parseDate(link.match(/(\d{4}-\d{2}-\d{2}-\d{2}-\d{2}-\d{2})/)[1], 'YYYY-MM-DD-HH-mm-ss'), +9); +const getPubDate = (link) => { + const matches = link.match(/(\d{4}-\d{2}-\d{2}-\d{2}-\d{2}-\d{2}|\d{8})/); + return matches ? timezone(parseDate(matches[1], 'YYYY-MM-DD-HH-mm-ss'), +9) : undefined; +}; module.exports = async (ctx) => { const language = ctx.params.language ?? 'cn';