mirror of
https://github.com/iptv-org/epg.git
synced 2025-05-10 09:00:07 -04:00
Update ontvtonight.com.config.js
This commit is contained in:
parent
0ace0feca7
commit
dab0737cd6
1 changed files with 8 additions and 2 deletions
|
@ -38,15 +38,17 @@ module.exports = {
|
||||||
items.forEach(item => {
|
items.forEach(item => {
|
||||||
const title = parseTitle(item)
|
const title = parseTitle(item)
|
||||||
const start = parseStart(item, date)
|
const start = parseStart(item, date)
|
||||||
|
const stop = parseStop(item, date)
|
||||||
|
|
||||||
if (title && start) {
|
if (title && start) {
|
||||||
if (programs.length && !programs[programs.length - 1].stop) {
|
if (programs.length) {
|
||||||
programs[programs.length - 1].stop = start
|
programs[programs.length - 1].stop = start
|
||||||
}
|
}
|
||||||
|
|
||||||
programs.push({
|
programs.push({
|
||||||
title,
|
title,
|
||||||
start
|
start,
|
||||||
|
stop
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -55,6 +57,10 @@ module.exports = {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function parseStop(item, date) {
|
||||||
|
return date.tz('Europe/London').endOf('d')
|
||||||
|
}
|
||||||
|
|
||||||
function parseStart(item, date) {
|
function parseStart(item, date) {
|
||||||
let time = (item.querySelector('td:nth-child(1) > h5') || { textContent: '' }).textContent.trim()
|
let time = (item.querySelector('td:nth-child(1) > h5') || { textContent: '' }).textContent.trim()
|
||||||
time = `${date.format('DD/MM/YYYY')} ${time.toUpperCase()}`
|
time = `${date.format('DD/MM/YYYY')} ${time.toUpperCase()}`
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue