From b4fed8101a5b76d8c81acfd9c1d81f11fa66ab98 Mon Sep 17 00:00:00 2001 From: John Ralls Date: Wed, 31 May 2017 12:06:53 -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 ce6e54afc..3ef821e4c 100644 --- a/gramps/gen/datehandler/_dateparser.py +++ b/gramps/gen/datehandler/_dateparser.py @@ -618,12 +618,11 @@ class DateParser: 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