fix(route): migrate WHO routes to new time parser (#7528)

This commit is contained in:
Queensferry 2022-02-02 01:59:52 +08:00 committed by GitHub
parent b2e533a80d
commit 2aa3dd8f8b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -1,7 +1,7 @@
const got = require('@/utils/got');
const cheerio = require('cheerio');
const url = require('url');
const date = require('@/utils/date');
const { parseDate } = require('@/utils/parse-date');
const host = 'https://www.who.int/';
@ -20,7 +20,7 @@ module.exports = async (ctx) => {
const $elem = $(elem);
const title = $elem.find('p').text();
const link = url.resolve(host, $elem.find('a').attr('href'));
const pubDate = date($elem.find('.timestamp').text());
const pubDate = parseDate($elem.find('.timestamp').text(), 'YYYY年M月D日');
const item = {
title,