mirror of
https://github.com/iptv-org/epg.git
synced 2025-05-10 09:00:07 -04:00
Simplified date comparison
This commit is contained in:
parent
5a037ff089
commit
1f74bff26c
1 changed files with 2 additions and 6 deletions
|
@ -38,9 +38,7 @@ module.exports = {
|
||||||
for(let scheduleDate of scheduleDates) {
|
for(let scheduleDate of scheduleDates) {
|
||||||
const currentScheduleDate = new dayjs.utc(scheduleDate.date, 'YYYY/MM/DD')
|
const currentScheduleDate = new dayjs.utc(scheduleDate.date, 'YYYY/MM/DD')
|
||||||
|
|
||||||
if (currentScheduleDate.isBefore(today)) {
|
if (currentScheduleDate.isSame(today)) {
|
||||||
continue
|
|
||||||
} else if (currentScheduleDate.isBefore(lastDay)) {
|
|
||||||
scheduleDate.schedule.forEach(function(program, i) {
|
scheduleDate.schedule.forEach(function(program, i) {
|
||||||
programs.push({
|
programs.push({
|
||||||
title: program.title,
|
title: program.title,
|
||||||
|
@ -51,9 +49,7 @@ module.exports = {
|
||||||
category: program.categoryName,
|
category: program.categoryName,
|
||||||
rating: program.ageRating
|
rating: program.ageRating
|
||||||
})
|
})
|
||||||
})
|
});
|
||||||
} else {
|
|
||||||
continue
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue