mirror of
https://github.com/iptv-org/epg.git
synced 2025-05-10 00:50:09 -04:00
Bug fix on parsing the end-of-day stop time
This commit is contained in:
parent
51359b0e21
commit
1f50f0c0ce
1 changed files with 7 additions and 5 deletions
|
@ -53,14 +53,16 @@ module.exports = {
|
||||||
|
|
||||||
function parseItems(content) {
|
function parseItems(content) {
|
||||||
const $ = cheerio.load(content)
|
const $ = cheerio.load(content)
|
||||||
let schDayMonths = $('.date-slider .slide').toArray()
|
const schDayMonths = $('.date-slider .slide').toArray()
|
||||||
let schPrograms = $('.desc-slider .list-slider .accordion').toArray()
|
const schPrograms = $('.desc-slider .list-slider').toArray()
|
||||||
let items = [];
|
let items = [];
|
||||||
schDayMonths.forEach(function(schDayMonth, i) {
|
schDayMonths.forEach(function(schDayMonth, i) {
|
||||||
schPrograms.forEach(function(program, i) {
|
let schDayPrograms = $(schPrograms[i]).find('.accordion').toArray()
|
||||||
|
//let schDayPrograms = $('.accordion').toArray()
|
||||||
|
schDayPrograms.forEach(function(program, i) {
|
||||||
let itemDay = {
|
let itemDay = {
|
||||||
progStart: parseStart(schDayMonth, program),
|
progStart: parseStart(schDayMonth, program),
|
||||||
progStop: parseStop(schDayMonth, program, schPrograms[i+1]),
|
progStop: parseStop(schDayMonth, program, schDayPrograms[i+1]),
|
||||||
progTitle: parseTitle(program),
|
progTitle: parseTitle(program),
|
||||||
progDesc: parseDescription(program)
|
progDesc: parseDescription(program)
|
||||||
};
|
};
|
||||||
|
@ -95,6 +97,6 @@ function parseStop(schDayMonth, itemCurrent, itemNext) {
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return dayjs.tz(currentYear + ' ' + monthDate[0] + ' ' + monthDate[1] + ' 24:00', 'YYYY MMM DD HH:mm', 'Asia/Jakarta')
|
return dayjs.tz(currentYear + ' ' + monthDate[0] + ' ' + (parseInt(monthDate[1]) + 1) + ' 00:00', 'YYYY MMM DD HH:mm', 'Asia/Jakarta')
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Add table
Add a link
Reference in a new issue