program: show days in order…
This commit is contained in:
parent
8739e69ab8
commit
a79aa6db60
|
@ -88,7 +88,7 @@ class Program:
|
||||||
|
|
||||||
def _body(self):
|
def _body(self):
|
||||||
output = ''
|
output = ''
|
||||||
for day in self.days.keys():
|
for day in sorted(self.days.keys()):
|
||||||
output += self._day_header(day)
|
output += self._day_header(day)
|
||||||
output += self._day(day)
|
output += self._day(day)
|
||||||
return output
|
return output
|
||||||
|
@ -142,7 +142,6 @@ class Program:
|
||||||
start = ts
|
start = ts
|
||||||
end = self.days[day]['timeslots'][self.days[day]['timeslots'].index(ts)+1]
|
end = self.days[day]['timeslots'][self.days[day]['timeslots'].index(ts)+1]
|
||||||
duration = (end - start).seconds / 60
|
duration = (end - start).seconds / 60
|
||||||
print(start, end, duration)
|
|
||||||
date_to_string = lambda date: datetime.strftime(localtime(date), '%H:%M')
|
date_to_string = lambda date: datetime.strftime(localtime(date), '%H:%M')
|
||||||
style = 'height: %dpx;' % int(duration * 1.2)
|
style = 'height: %dpx;' % int(duration * 1.2)
|
||||||
timeslot = '<td>%s – %s</td>' % tuple(map(date_to_string, [start, end]))
|
timeslot = '<td>%s – %s</td>' % tuple(map(date_to_string, [start, end]))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user