program: show days in order…

This commit is contained in:
Élie Bouttier 2016-10-19 00:01:10 +02:00
parent 8739e69ab8
commit a79aa6db60
1 changed files with 1 additions and 2 deletions

View File

@ -88,7 +88,7 @@ class Program:
def _body(self):
output = ''
for day in self.days.keys():
for day in sorted(self.days.keys()):
output += self._day_header(day)
output += self._day(day)
return output
@ -142,7 +142,6 @@ class Program:
start = ts
end = self.days[day]['timeslots'][self.days[day]['timeslots'].index(ts)+1]
duration = (end - start).seconds / 60
print(start, end, duration)
date_to_string = lambda date: datetime.strftime(localtime(date), '%H:%M')
style = 'height: %dpx;' % int(duration * 1.2)
timeslot = '<td>%s %s</td>' % tuple(map(date_to_string, [start, end]))