ensures all day events are on top and works with python 2.6
Merge branch 'events-order'