mirror of
https://github.com/iptv-org/epg.git
synced 2025-05-10 00:50:09 -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 time = (item.querySelector('div.b-livestreaming-daily-schedule__item-content-caption') || { textContent: '' }).textContent
|
||||
if (title && time) {
|
||||
let start = dayjs(listdate.format('YYYY-MM-DD ').concat(time.substring(0,5)), 'YYYY-MM-DD HH:mm')
|
||||
let stop = dayjs(listdate.format('YYYY-MM-DD ').concat(time.substring(8,13)), 'YYYY-MM-DD HH:mm')
|
||||
if (start.diff(stop, 'h') < 0) {
|
||||
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').utc()
|
||||
if (start.diff(stop, 'h') > 0) {
|
||||
stop = stop.add(1, 'day')
|
||||
}
|
||||
|
||||
if (listdate.diff(date.format('YYYY-MM-DD'), 'd') === 0) {
|
||||
programs.push({
|
||||
title,
|
||||
start.utc(),
|
||||
stop.utc()
|
||||
start,
|
||||
stop
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue