From 180cb1ac28bae3833b6c52100615c9802837c5b6 Mon Sep 17 00:00:00 2001 From: Vassilii Khachaturov Date: Thu, 19 Sep 2013 22:06:27 +0000 Subject: [PATCH] 6926: add partial dates (M/Y and Y), not just DMY svn: r23166 --- gramps/plugins/tool/dateparserdisplaytest.py | 21 ++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/gramps/plugins/tool/dateparserdisplaytest.py b/gramps/plugins/tool/dateparserdisplaytest.py index 3d7a3031d..b54f697e8 100644 --- a/gramps/plugins/tool/dateparserdisplaytest.py +++ b/gramps/plugins/tool/dateparserdisplaytest.py @@ -82,22 +82,35 @@ class DateParserDisplayTest(tool.Tool): for modifier in (Date.MOD_NONE, Date.MOD_BEFORE, Date.MOD_AFTER, Date.MOD_ABOUT): for slash1 in (False,True): - for month in range(1,13): - for day in (5,27): + for month in range(0,13): + for day in (0,5,27): + if not month and day: + continue d = Date() d.set(quality,modifier,calendar,(day,month,1789,slash1),"Text comment") dates.append( d) for modifier in (Date.MOD_RANGE, Date.MOD_SPAN): for slash1 in (False,True): for slash2 in (False,True): - for month in range(1,13): - for day in (5,27): + for month in range(0,13): + for day in (0,5,27): + if not month and day: + continue + d = Date() d.set(quality,modifier,calendar,(day,month,1789,slash1,day,month,1876,slash2),"Text comment") dates.append( d) + + if not month: + continue + d = Date() d.set(quality,modifier,calendar,(day,month,1789,slash1,day,13-month,1876,slash2),"Text comment") dates.append( d) + + if not day: + continue + d = Date() d.set(quality,modifier,calendar,(day,month,1789,slash1,32-day,month,1876,slash2),"Text comment") dates.append( d)