From 7f0f45cb7b97b6def874372f98ee49a7840aa587 Mon Sep 17 00:00:00 2001 From: Don Allingham Date: Wed, 21 Aug 2002 04:16:03 +0000 Subject: [PATCH] Date comparison fix svn: r1125 --- gramps/src/Date.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/gramps/src/Date.py b/gramps/src/Date.py index 397087aae..01856b202 100644 --- a/gramps/src/Date.py +++ b/gramps/src/Date.py @@ -1024,7 +1024,6 @@ def compare_dates(f,s): return cmp(f.text,s.text) if f.range == -1 or s.range == -1: return -1 - first = f.get_start_date() second = s.get_start_date() if first.year != second.year: @@ -1033,6 +1032,8 @@ def compare_dates(f,s): return cmp(first.month,second.month) elif f.range != 1: return cmp(first.day,second.day) + elif first.mode != second.mode: + return 1 else: first = f.get_stop_date() second = s.get_stop_date() @@ -1040,8 +1041,10 @@ def compare_dates(f,s): return cmp(first.year,second.year) elif first.month != second.month: return cmp(first.month,second.month) - else: + else if first.mode == second.mode: return cmp(first.day,second.day) + else: + return 1 _func = SingleDate.fmtFunc[0]