mirror of
https://github.com/iptv-org/epg.git
synced 2025-05-10 09:00:07 -04:00
actually set utc() + fixed time overflow detection
This commit is contained in:
parent
ac5fe18a91
commit
ae36f830a5
1 changed files with 5 additions and 5 deletions
|
@ -34,17 +34,17 @@ module.exports = {
|
||||||
const title = (item.querySelector('div.b-livestreaming-daily-schedule__item-content-title') || { textContent: '' }).textContent
|
const title = (item.querySelector('div.b-livestreaming-daily-schedule__item-content-title') || { textContent: '' }).textContent
|
||||||
const time = (item.querySelector('div.b-livestreaming-daily-schedule__item-content-caption') || { textContent: '' }).textContent
|
const time = (item.querySelector('div.b-livestreaming-daily-schedule__item-content-caption') || { textContent: '' }).textContent
|
||||||
if (title && time) {
|
if (title && time) {
|
||||||
let start = dayjs(listdate.format('YYYY-MM-DD ').concat(time.substring(0,5)), 'YYYY-MM-DD HH:mm')
|
let start = dayjs(listdate.format('YYYY-MM-DD ').concat(time.substring(0,5)), 'YYYY-MM-DD HH:mm').utc()
|
||||||
let stop = dayjs(listdate.format('YYYY-MM-DD ').concat(time.substring(8,13)), 'YYYY-MM-DD HH:mm')
|
let stop = dayjs(listdate.format('YYYY-MM-DD ').concat(time.substring(8,13)), 'YYYY-MM-DD HH:mm').utc()
|
||||||
if (start.diff(stop, 'h') < 0) {
|
if (start.diff(stop, 'h') > 0) {
|
||||||
stop = stop.add(1, 'day')
|
stop = stop.add(1, 'day')
|
||||||
}
|
}
|
||||||
|
|
||||||
if (listdate.diff(date.format('YYYY-MM-DD'), 'd') === 0) {
|
if (listdate.diff(date.format('YYYY-MM-DD'), 'd') === 0) {
|
||||||
programs.push({
|
programs.push({
|
||||||
title,
|
title,
|
||||||
start.utc(),
|
start,
|
||||||
stop.utc()
|
stop
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue