1

I am storing some calendar items in an array like so,

[
 {'CALENDAR': 'HOME',
  'SUMMARY': vText('b'Run''),
  'LOCATION': vText('b'''),
  'START': datetime.datetime(2017, 9, 29, 18, 0, tzinfo=<DstTzInfo 'US/Pacific' PDT-1 day, 17:00:00 DST>),
  'END': datetime.datetime(2017, 9, 29, 18, 45, tzinfo=<DstTzInfo 'US/Pacific' PDT-1 day, 17:00:00 DST>)},
 {'CALENDAR': 'HOME',
  'SUMMARY': vText('b'Tacos''),
  'LOCATION': vText('b'''),
  'START': datetime.datetime(2017, 10, 2, 19, 0, tzinfo=<DstTzInfo 'US/Pacific' PDT-1 day, 17:00:00 DST>),
  'END': datetime.datetime(2017, 10, 2, 20, 0, tzinfo=<DstTzInfo 'US/Pacific' PDT-1 day, 17:00:00 DST>)},
 {'CALENDAR': 'WORK',
  'SUMMARY': vText('b'Work''),
  'LOCATION': vText('b'3740 West Market Center Drive\\, Riverton\\, UT\xc2\xa0 84065''),
  'START': datetime.datetime(2017, 8, 21, 8, 0, tzinfo=<DstTzInfo 'America/Denver' MDT-1 day, 18:00:00 DST>),
  'END': datetime.datetime(2017, 8, 21, 17, 0, tzinfo=<DstTzInfo 'America/Denver' MDT-1 day, 18:00:00 DST>)}
 ]

I am wondering if there is a way that I can sort the array by the dictionary value 'START' so that the earliest event is listed first in the array and I can print the information I want to from there, any thoughts?

jgummersall
  • 31
  • 1
  • 6

0 Answers0