From 3828dff5de680970c5f682b6263c2d616e3df5aa Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Fri, 24 Sep 2021 18:57:50 +0300 Subject: [PATCH] Update hd-plus.de.config.js --- sites/hd-plus.de.config.js | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/sites/hd-plus.de.config.js b/sites/hd-plus.de.config.js index e69ec966..50029c41 100644 --- a/sites/hd-plus.de.config.js +++ b/sites/hd-plus.de.config.js @@ -11,12 +11,13 @@ dayjs.extend(customParseFormat) module.exports = { lang: 'de', + days: 3, site: 'hd-plus.de', channels: 'hd-plus.de.channels.xml', output: '.gh-pages/guides/hd-plus.de.guide.xml', url({ date, channel }) { - const now = dayjs() - const day = now.diff(date, 'd') + const today = dayjs().utc().startOf('d') + const day = date.diff(today, 'd') return `https://www.hd-plus.de/epg/channel/${channel.site_id}?d=${day}` }, @@ -32,7 +33,7 @@ module.exports = { items.forEach(item => { const title = parseTitle(item) let start = parseStart(item, date) - const stop = parseStop(item, date) + const stop = start.add(1, 'h') if (programs.length) { programs[programs.length - 1].stop = start } @@ -44,10 +45,6 @@ module.exports = { } } -function parseStop(item, date) { - return date.endOf('d') -} - function parseStart(item, date) { let time = (item.querySelector('td:nth-child(2)') || { textContent: '' }).textContent time = time.split(' ').pop()