From 2ff608e798a29256380e1ec41d15a83377d4d418 Mon Sep 17 00:00:00 2001 From: Gary Burton Date: Sun, 5 Feb 2012 12:58:05 +0000 Subject: [PATCH] Ensure dates are sorted by key. Bug #5493 svn: r18822 --- src/Sort.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Sort.py b/src/Sort.py index ff5fb2c8e..90ef6e4ba 100644 --- a/src/Sort.py +++ b/src/Sort.py @@ -158,14 +158,16 @@ class Sort(object): return 0 a_obj = self.database.get_event_from_handle(a_id) b_obj = self.database.get_event_from_handle(b_id) - return cmp(a_obj.get_date_object(), b_obj.get_date_object()) + dsv1 = a_obj.get_date_object().get_sort_value() + dsv2 = b_obj.get_date_object().get_sort_value() + return cmp(dsv1, dsv2) def by_date_key(self, a_id): """Sort routine for comparing two events by their dates. """ if not a_id: return 0 a_obj = self.database.get_event_from_handle(a_id) - return a_obj.get_date_object() + return a_obj.get_date_object().get_sort_value() def by_place_title(self, a_id, b_id): """Sort routine for comparing two places. """