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 => {
|
||||
const title = parseTitle(item)
|
||||
const start = parseStart(item, date)
|
||||
const stop = parseStop(item, date)
|
||||
|
||||
if (title && start) {
|
||||
if (programs.length && !programs[programs.length - 1].stop) {
|
||||
if (programs.length) {
|
||||
programs[programs.length - 1].stop = start
|
||||
}
|
||||
|
||||
programs.push({
|
||||
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) {
|
||||
let time = (item.querySelector('td:nth-child(1) > h5') || { textContent: '' }).textContent.trim()
|
||||
time = `${date.format('DD/MM/YYYY')} ${time.toUpperCase()}`
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue