diff --git a/gramps/gen/datehandler/_date_nb.py b/gramps/gen/datehandler/_date_nb.py index f126e43a4..eaec57795 100644 --- a/gramps/gen/datehandler/_date_nb.py +++ b/gramps/gen/datehandler/_date_nb.py @@ -58,6 +58,7 @@ class DateParserNb(DateParser): 'innen' : Date.MOD_BEFORE, 'etter' : Date.MOD_AFTER, 'omkring' : Date.MOD_ABOUT, + 'omtrent' : Date.MOD_ABOUT, 'ca' : Date.MOD_ABOUT } @@ -89,8 +90,8 @@ class DateParserNb(DateParser): def init_strings(self): DateParser.init_strings(self) - # match day. month year - self._numeric = re.compile(r"((\d+)[\.])?\s*((\d+))?\s*(\d+)$") + self._numeric = re.compile( + r"((\d+)[/\.\s]\s*)?((\d+)[/\.\-\s]\s*)?(\d+)\s*$") self._span = re.compile( r"(fra)?\s*(?P.+)\s*(til|--|–)\s*(?P.+)", re.IGNORECASE) @@ -174,6 +175,10 @@ class DateDisplayNb(DateDisplay): return "%s%s%s%s" % (qual_str, self._mod_str[mod], text, scal) + def dd_dformat01(self, date_val): + """ numerical -- for Norwegian dates """ + return DateDisplay.dd_dformat01(self, date_val).lstrip() + #------------------------------------------------------------------------- # # Register classes