From f0b5eefc48ac2fe629beafb3053c7f463de11e52 Mon Sep 17 00:00:00 2001 From: Don Allingham Date: Thu, 17 May 2001 02:59:15 +0000 Subject: [PATCH] Fixed date ranges when using a non-English language svn: r19 --- gramps/src/Date.py | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/gramps/src/Date.py b/gramps/src/Date.py index 49029978c..12c41d8b8 100644 --- a/gramps/src/Date.py +++ b/gramps/src/Date.py @@ -43,9 +43,12 @@ class Date: from_str = _("(from|between|bet)") to_str = _("(and|to)") - fmt = re.compile("\s*" + from_str + "(.+)" + to_str + "(.+)\s*$", + efmt = re.compile(r"\s*(from|between|bet)\s+(.+)\s+(and|to)\s+(.+)\s*$", re.IGNORECASE) + fmt = re.compile(r"\s*" + from_str + r"\s+(.+)\s+" + to_str + r"\s+(.+)\s*$", + re.IGNORECASE) + def __init__(self): self.start = SingleDate() self.stop = SingleDate() @@ -130,16 +133,12 @@ class Date: #-------------------------------------------------------------------- def quick_set(self,text): try: - if text[0:2] == "FR": - match = Date.fmt.match(text) - if match: - matches = match.groups() - self.start.set(matches[1]) - self.stop.set(matches[3]) - self.range = 1 - else: - self.range = -1 - self.text = text + match = Date.efmt.match(text) + if match: + matches = match.groups() + self.start.set(matches[1]) + self.stop.set(matches[3]) + self.range = 1 else: try: self.start.quick_set(text)