From ed495982a5d270a42e5f406bf5b24f562fa14bca Mon Sep 17 00:00:00 2001 From: Don Allingham Date: Fri, 17 Sep 2004 04:32:01 +0000 Subject: [PATCH] update svn: r3549 --- gramps2/src/GenericFilter.py | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/gramps2/src/GenericFilter.py b/gramps2/src/GenericFilter.py index 782c1d0ad..dfd996575 100644 --- a/gramps2/src/GenericFilter.py +++ b/gramps2/src/GenericFilter.py @@ -48,7 +48,6 @@ import gtk import const import RelLib import Date -import Calendar from TransTable import TransTable from gettext import gettext as _ from Utils import for_each_ancestor @@ -60,15 +59,14 @@ from Utils import for_each_ancestor #------------------------------------------------------------------------- def date_cmp(rule,value): sd = rule.get_start_date() - s = sd.mode - if s == Calendar.BEFORE: - return Date.compare_dates(rule,value) == 1 - elif s == Calendar.AFTER: - return Date.compare_dates(rule,value) == -1 - elif sd.month == Date.UNDEF and sd.year != Date.UNDEF: - return sd.year == value.get_start_date().year + s = sd.get_modifier() + val = s.get_start_date() + if s == Date.MOD_BEFORE: + return rule > value + elif s == Date.MOD_AFTER: + return rule < value else: - return Date.compare_dates(rule,value) == 0 + return rule == value #------------------------------------------------------------------------- #