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';