fix(route): migrate WHO routes to new time parser (#7528)
This commit is contained in:
parent
b2e533a80d
commit
2aa3dd8f8b
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Reference in New Issue