Commit fec07f22 authored by fred's avatar fred

grid: don't add endtime if same duration in same grid

parent 16d6ae16
......@@ -450,15 +450,25 @@ class Grid(TemplateView):
end_time.minute,
)
schedule_list.sort(key=lambda x: x.weeks)
for schedule in schedule_list[1:]:
grid[i][j].schedules.remove(schedule)
end_time = schedule.datetime + timedelta(minutes=schedule.get_duration())
# TODO: si tout la même durée, merge possible ?
schedule_list[0].time_label_extra = ', -%02d:%02d %s' % (
end_time.hour,
end_time.minute,
schedule.weeks_string,
)
if schedule_list[0].get_duration() == schedule.get_duration():
# same duration, append week info
schedule_list[0].time_label_extra = ', %s' % (schedule.weeks_string,)
else:
# different durations, also append other
# endtime info
schedule_list[0].time_label_extra = ', -%02d:%02d %s' % (
end_time.hour,
end_time.minute,
schedule.weeks_string,
)
import pdb
pdb.set_trace()
pass
# merge adjacent
......
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