1
0
forked from HPR/hpr_generator

Fix calculation of the days until next available episode timeslot

Do all date calulation in DB instead of naively adding 1 to the
day that is returned.
This commit is contained in:
2023-05-18 09:04:04 -04:00
parent 69255693ef
commit e7fe824302
3 changed files with 7 additions and 7 deletions

View File

@@ -6,9 +6,9 @@
)
SELECT
MIN(next_id.id_next) AS \'next_id\',
DATE_FORMAT(MIN(last_date), \'%Y\') AS \'last_year\',
DATE_FORMAT(MIN(last_date), \'%d\') AS \'last_day\',
DATE_FORMAT(MIN(last_date), \'%m\') AS \'last_month\'
DATE_FORMAT(DATE_ADD(MIN(last_date), INTERVAL 1 DAY), \'%Y\') AS \'last_year\',
DATE_FORMAT(DATE_ADD(MIN(last_date), INTERVAL 1 DAY), \'%d\') AS \'last_day\',
DATE_FORMAT(DATE_ADD(MIN(last_date), INTERVAL 1 DAY), \'%m\') AS \'last_month\'
FROM next_id
LEFT JOIN eps ON next_id.id_next = eps.id
WHERE eps.id IS NULL