From 7504faaedc44dee31e67d918cc680d5da724a8d6 Mon Sep 17 00:00:00 2001 From: Axojhf <20625305+axojhf@users.noreply.github.com> Date: Mon, 22 Aug 2022 18:02:51 +0800 Subject: [PATCH] =?UTF-8?q?fix(route):=20=E6=88=98=E4=BA=89=E9=9B=B7?= =?UTF-8?q?=E9=9C=86=E8=8B=B1=E6=96=87=E5=AE=98=E7=BD=91-=E6=96=B0?= =?UTF-8?q?=E9=97=BB=E7=89=88=E5=9D=97=20=E6=97=B6=E5=8C=BA=E9=97=AE?= =?UTF-8?q?=E9=A2=98=20(#10563)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix warthunder timezone issue * add ; * add timezone * fix time zone issue --- docs/en/game.md | 1 + docs/game.md | 1 + lib/v2/warthunder/news.js | 4 +++- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/en/game.md b/docs/en/game.md index a8d269ea7b..3acc0d1563 100755 --- a/docs/en/game.md +++ b/docs/en/game.md @@ -288,5 +288,6 @@ Steam provides some official RSS feeds: News data from https://warthunder.com/en/news/ +The year, month and day provided under UTC time zone are the same as the official website, so please ignore the specific time!!! \ No newline at end of file diff --git a/docs/game.md b/docs/game.md index 886830201b..4fb519fe6d 100644 --- a/docs/game.md +++ b/docs/game.md @@ -500,6 +500,7 @@ Steam 新闻中心支持官方的 RSS 订阅: News 的数据来自 +在UTC时区下提供的年月日与官网上一致,请忽略具体的时间!!! diff --git a/lib/v2/warthunder/news.js b/lib/v2/warthunder/news.js index a15727982f..d998f216ec 100644 --- a/lib/v2/warthunder/news.js +++ b/lib/v2/warthunder/news.js @@ -3,6 +3,7 @@ const cheerio = require('cheerio'); const path = require('path'); const { art } = require('@/utils/render'); const { parseDate } = require('@/utils/parse-date'); +const timezone = require('@/utils/timezone'); const renderDescription = (desc) => art(path.join(__dirname, 'templates/description.art'), desc); module.exports = async (ctx) => { @@ -15,7 +16,8 @@ module.exports = async (ctx) => { const pageFace = $('div.showcase__item.widget') .map((_, item) => { item = $(item); - const pubDate = parseDate(item.find('div.widget__content > ul > li').text(), 'D MMMM YYYY'); + let pubDate = parseDate(item.find('div.widget__content > ul > li').text(), 'D MMMM YYYY'); + pubDate = timezone(pubDate, 0); const category = []; if (item.find('div.widget__pin').length !== 0) { category.push('pinned');