* src/DateParser.py: handle non-matching dates as strings properly

svn: r5269
This commit is contained in:
Don Allingham 2005-10-04 15:48:58 +00:00
parent 2b60db6940
commit 278b7751ba
2 changed files with 7 additions and 1 deletions

View File

@ -1,3 +1,6 @@
2005-10-04 Don Allingham <don@gramps-project.org>
* src/DateParser.py: handle non-matching dates as strings properly
2005-10-04 Stefan Bjork <skalman@acc.umu.se>
* src/dates/Date_sv.py: Fixes. No differences from english version
on test data.

View File

@ -550,6 +550,7 @@ class DateParser:
(text,cal) = self.match_calendar(text,cal)
(text,qual) = self.match_quality(text,qual)
if self.match_span(text,cal,qual,date):
return
if self.match_range(text,cal,qual,date):
@ -559,9 +560,11 @@ class DateParser:
if self.match_modifier(text,cal,qual,bc,date):
return
try:
subdate = self._parse_subdate(text,self.parser[cal])
if subdate == Date.EMPTY and text != "":
date.set_as_text(text)
return
except:
date.set_as_text(text)
return