Commit d71bc585 authored by fred's avatar fred

always use same day change line

parent de64aca5
......@@ -278,9 +278,8 @@ def period_program(date_start, date_end, prefetch_sounds=True,
cells.extend(cls.get_serie(last_added_end, end))
return cells
first_day_start = datetime(*date_start.replace(hour=6, minute=0).timetuple()[:5])
last_day_end = datetime(*date_end.replace(hour=5, minute=0).timetuple()[:5])
first_day_start = datetime(*date_start.replace(hour=Schedule.DAY_HOUR_START, minute=Schedule.DAY_MINUTE_START).timetuple()[:5])
last_day_end = datetime(*date_end.replace(hour=Schedule.DAY_HOUR_START, minute=Schedule.DAY_MINUTE_START).timetuple()[:5])
if program:
program[0:0] = NonstopSlot.get_serie(first_day_start, program[0].datetime)
......@@ -293,7 +292,7 @@ def period_program(date_start, date_end, prefetch_sounds=True,
next_slot = program[i+1]
if slot_end < next_slot.datetime:
next_day_start = next_slot.datetime.replace(hour=5, minute=0)
next_day_start = next_slot.datetime.replace(hour=Schedule.DAY_HOUR_START, minute=Schedule.DAY_MINUTE_START)
if slot_end < next_day_start and next_slot.datetime > next_day_start:
nonstop_day_slots = NonstopSlot.get_serie(slot_end, next_day_start)
nonstop_next_day_slots = NonstopSlot.get_serie(next_day_start, next_slot.datetime)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment