mirror of
https://github.com/iptv-org/epg
synced 2025-12-17 02:47:02 -05:00
Update m.tv.sms.cz.config.js
Fixes wrong date of next day programs
This commit is contained in:
@@ -29,7 +29,7 @@ module.exports = {
|
|||||||
const programs = []
|
const programs = []
|
||||||
const dom = new JSDOM(content)
|
const dom = new JSDOM(content)
|
||||||
const items = dom.window.document.querySelectorAll('#obsah > div > div.porady > div.porad')
|
const items = dom.window.document.querySelectorAll('#obsah > div > div.porady > div.porad')
|
||||||
items.forEach(item => {
|
items.forEach((item, i) => {
|
||||||
const time = (item.querySelector('div > span') || { textContent: '' }).textContent
|
const time = (item.querySelector('div > span') || { textContent: '' }).textContent
|
||||||
.toString()
|
.toString()
|
||||||
.trim()
|
.trim()
|
||||||
@@ -41,11 +41,11 @@ module.exports = {
|
|||||||
.trim()
|
.trim()
|
||||||
|
|
||||||
if (time && title) {
|
if (time && title) {
|
||||||
const local = dayjs
|
let local = dayjs.utc(time, 'HH.mm').date(date.date()).month(date.month()).year(date.year())
|
||||||
.utc(time, 'HH.mm')
|
|
||||||
.date(date.date())
|
if (local.hour() <= 6 && i > items.length / 2) {
|
||||||
.month(date.month())
|
local = local.date(local.date() + 1)
|
||||||
.year(date.year())
|
}
|
||||||
const start = dayjs.tz(local.toString(), 'Europe/Prague').toString()
|
const start = dayjs.tz(local.toString(), 'Europe/Prague').toString()
|
||||||
|
|
||||||
if (programs.length && !programs[programs.length - 1].stop) {
|
if (programs.length && !programs[programs.length - 1].stop) {
|
||||||
|
|||||||
Reference in New Issue
Block a user