From 90b494002ee7c91ff837d7c9edef9f50e37e3005 Mon Sep 17 00:00:00 2001 From: Keo Date: Mon, 13 Nov 2023 22:56:08 +0800 Subject: [PATCH] fix(route): fix pubDate timezone for route e-hentai (#13774) * fix(e-hentai): fix pubDate timezone for non-GMT servers * Update lib/v2/ehentai/ehapi.js --------- --- lib/v2/ehentai/ehapi.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/v2/ehentai/ehapi.js b/lib/v2/ehentai/ehapi.js index 123eac668..d5315eae0 100644 --- a/lib/v2/ehentai/ehapi.js +++ b/lib/v2/ehentai/ehapi.js @@ -1,5 +1,6 @@ const got = require('@/utils/got'); const logger = require('@/utils/logger'); +const timezone = require('@/utils/timezone'); const cheerio = require('cheerio'); const path = require('path'); const config = require('@/config').value.ehentai; @@ -76,7 +77,8 @@ async function parsePage(cache, data, get_bittorrent = false, embed_thumb = fals async function parseElement(cache, element) { const el = $(element); const title = el.find('div.glink').html(); - const pubDate = el.find('div[id^="posted_"]').html(); + const rawDate = el.find('div[id^="posted_"]').text(); + const pubDate = rawDate ? timezone(rawDate, 0) : rawDate; let el_a; let el_img; // match layout