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:
@@ -6,9 +6,9 @@
|
||||
)
|
||||
SELECT
|
||||
MIN(next_id.id_next) AS \'next_id\',
|
||||
strftime(\'%Y\', MIN (last_date)) AS \'last_year\',
|
||||
strftime(\'%d\', MIN (last_date)) AS \'last_day\',
|
||||
strftime(\'%m\', MIN (last_date)) AS \'last_month\'
|
||||
strftime(\'%Y\', DATE (MIN (last_date), \'+1 Days\')) AS \'last_year\',
|
||||
strftime(\'%d\', DATE (MIN (last_date), \'+1 Days\')) AS \'last_day\',
|
||||
strftime(\'%m\', DATE (MIN (last_date), \'+1 Days\')) AS \'last_month\'
|
||||
FROM next_id
|
||||
LEFT JOIN eps ON next_id.id_next = eps.id
|
||||
WHERE eps.id IS NULL
|
||||
|
Reference in New Issue
Block a user