From 1f74bff26c77edda4b817c64a670f60a909578c1 Mon Sep 17 00:00:00 2001 From: Arif Budiman Date: Sun, 20 Aug 2023 22:37:16 -0700 Subject: [PATCH] Simplified date comparison --- sites/taiwanplus.com/taiwanplus.com.config.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/sites/taiwanplus.com/taiwanplus.com.config.js b/sites/taiwanplus.com/taiwanplus.com.config.js index 803f1844..d05b31de 100644 --- a/sites/taiwanplus.com/taiwanplus.com.config.js +++ b/sites/taiwanplus.com/taiwanplus.com.config.js @@ -38,9 +38,7 @@ module.exports = { for(let scheduleDate of scheduleDates) { const currentScheduleDate = new dayjs.utc(scheduleDate.date, 'YYYY/MM/DD') - if (currentScheduleDate.isBefore(today)) { - continue - } else if (currentScheduleDate.isBefore(lastDay)) { + if (currentScheduleDate.isSame(today)) { scheduleDate.schedule.forEach(function(program, i) { programs.push({ title: program.title, @@ -51,9 +49,7 @@ module.exports = { category: program.categoryName, rating: program.ageRating }) - }) - } else { - continue + }); } }