From 7a61a0e96fbacdc47b3dcbe9b25b7af971ce0be2 Mon Sep 17 00:00:00 2001 From: John Ralls Date: Wed, 31 May 2017 12:07:16 -0700 Subject: [PATCH] 8366: February 29th invalid date in Julian dual-dated leap year --- gramps/gen/datehandler/_dateparser.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/gramps/gen/datehandler/_dateparser.py b/gramps/gen/datehandler/_dateparser.py index a81f8539d..bbca3e3d4 100644 --- a/gramps/gen/datehandler/_dateparser.py +++ b/gramps/gen/datehandler/_dateparser.py @@ -597,12 +597,11 @@ class DateParser(object): y = self._get_int(groups[0]) m = self._get_int(groups[3]) d = self._get_int(groups[4]) - if check and not check((d, m, y)): - return Date.EMPTY - if groups[2]: # slash year digit + if groups[2] and julian_valid((d, m, y + 1)): # slash year digit return (d, m, y + 1, True) - else: + if check is None or check((d, m, y)): return (d, m, y, False) + return Date.EMPTY # Database datetime format, used in ex. MSSQL # YYYYMMDD HH:MM:SS or YYYYMMDD or YYYYMMDDHHMMSS