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

---------
This commit is contained in:
Keo 2023-11-13 22:56:08 +08:00 committed by GitHub
parent af11b7e767
commit 90b494002e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -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