mirror of
https://github.com/DIYgod/RSSHub.git
synced 2026-10-13 08:48:59 +08:00
fix(route): 战争雷霆英文官网-新闻版块 时区问题 (#10563)
* fix warthunder timezone issue * add ; * add timezone * fix time zone issue
This commit is contained in:
@@ -288,5 +288,6 @@ Steam provides some official RSS feeds:
|
||||
<RouteEn author="axojhf" example="/warthunder/news" path="/warthunder/news">
|
||||
|
||||
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!!!
|
||||
|
||||
</RouteEn>
|
||||
@@ -500,6 +500,7 @@ Steam 新闻中心支持官方的 RSS 订阅:
|
||||
<Route author="axojhf" example="/warthunder/news" path="/warthunder/news">
|
||||
|
||||
News 的数据来自 <https://warthunder.com/en/news/>
|
||||
在UTC时区下提供的年月日与官网上一致,请忽略具体的时间!!!
|
||||
|
||||
</Route>
|
||||
|
||||
|
||||
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user