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,
|
'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):
|
def init_strings(self):
|
||||||
DateParser.init_strings(self)
|
DateParser.init_strings(self)
|
||||||
self._text2 = re.compile('(\d+)?\.?\s+?%s\.?\s*((\d+)(/\d+)?)?\s*$'
|
self._text2 = re.compile('(\d+)?\.?\s+?%s\.?\s*((\d+)(/\d+)?)?\s*$'
|
||||||
|
@ -194,6 +194,7 @@ class DateParser:
|
|||||||
|
|
||||||
_locale = GrampsLocale(lang='en', languages='en')
|
_locale = GrampsLocale(lang='en', languages='en')
|
||||||
|
|
||||||
|
fmt = _grampslocale.tformat
|
||||||
_fmt_parse = re.compile(".*%(\S).*%(\S).*%(\S).*")
|
_fmt_parse = re.compile(".*%(\S).*%(\S).*%(\S).*")
|
||||||
|
|
||||||
# RFC-2822 only uses capitalized English abbreviated names, no locales.
|
# RFC-2822 only uses capitalized English abbreviated names, no locales.
|
||||||
@ -343,8 +344,7 @@ class DateParser:
|
|||||||
Date.CAL_SWEDISH : self._parse_swedish,
|
Date.CAL_SWEDISH : self._parse_swedish,
|
||||||
}
|
}
|
||||||
|
|
||||||
fmt = _grampslocale.tformat
|
match = self._fmt_parse.match(self.fmt.lower())
|
||||||
match = self._fmt_parse.match(fmt.lower())
|
|
||||||
if match:
|
if match:
|
||||||
self.dmy = (match.groups() == ('d', 'm', 'y') or \
|
self.dmy = (match.groups() == ('d', 'm', 'y') or \
|
||||||
match.groups() == ('d', 'b', 'y'))
|
match.groups() == ('d', 'b', 'y'))
|
||||||
|
Loading…
Reference in New Issue
Block a user