9739: Wrong parsing Numeric date format for cs_CZ locale
This commit is contained in:
parent
adca37f7fd
commit
ce4d4ca31d
@ -171,6 +171,9 @@ class DateParserCZ(DateParser):
|
||||
'vyp.' : Date.QUAL_CALCULATED,
|
||||
}
|
||||
|
||||
# bug 9739 _grampslocale.py gets '%-d.%-m.%Y' and makes it be '%/d.%/m.%Y'
|
||||
fmt = DateParser.fmt.replace('/', '') # so counteract that
|
||||
|
||||
def init_strings(self):
|
||||
DateParser.init_strings(self)
|
||||
self._text2 = re.compile('(\d+)?\.?\s+?%s\.?\s*((\d+)(/\d+)?)?\s*$'
|
||||
|
@ -194,6 +194,7 @@ class DateParser:
|
||||
|
||||
_locale = GrampsLocale(lang='en', languages='en')
|
||||
|
||||
fmt = _grampslocale.tformat
|
||||
_fmt_parse = re.compile(".*%(\S).*%(\S).*%(\S).*")
|
||||
|
||||
# RFC-2822 only uses capitalized English abbreviated names, no locales.
|
||||
@ -343,8 +344,7 @@ class DateParser:
|
||||
Date.CAL_SWEDISH : self._parse_swedish,
|
||||
}
|
||||
|
||||
fmt = _grampslocale.tformat
|
||||
match = self._fmt_parse.match(fmt.lower())
|
||||
match = self._fmt_parse.match(self.fmt.lower())
|
||||
if match:
|
||||
self.dmy = (match.groups() == ('d', 'm', 'y') or \
|
||||
match.groups() == ('d', 'b', 'y'))
|
||||
|
Loading…
Reference in New Issue
Block a user