Sort events by start date/time

main
Luca 3 years ago
parent 72e6d9bb1a
commit 3464c58288

@ -18,6 +18,7 @@ from collections import namedtuple
from datetime import * from datetime import *
from icalendar import Calendar from icalendar import Calendar
from itertools import count from itertools import count
from operator import attrgetter
from xml.dom import Node from xml.dom import Node
from xml.dom.minidom import getDOMImplementation from xml.dom.minidom import getDOMImplementation
@ -136,7 +137,7 @@ def calendar_to_xml(cal):
elem('track', ''), elem('track', ''),
id=next(id), id=next(id),
guid=event.guid, guid=event.guid,
), events), ), sorted(events, key=attrgetter('start'))),
_name=room, _name=room,
), rooms.keys(), rooms.values()), ), rooms.keys(), rooms.values()),
date=day.isoformat(), date=day.isoformat(),

Loading…
Cancel
Save