diff --git a/ChangeLog b/ChangeLog index 83eec6297..a19681d27 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-02-25 Douglas S. Blank + * src/DateHandler/_DateParser.py: set year += 1 + * src/gen/lib/date.py: removed slash-date fix + * src/gen/lib/test/date_test.py: slash dates sort correctly + 2008-02-25 Ɓukasz Rymarczyk * src/const.py.in: query os.environ for GRAMPSHOME env and use it 0001831: A patch allowing using a different home folder than default diff --git a/src/DateHandler/_DateParser.py b/src/DateHandler/_DateParser.py index 7fa17e04b..a229e7c55 100644 --- a/src/DateHandler/_DateParser.py +++ b/src/DateHandler/_DateParser.py @@ -595,7 +595,7 @@ class DateParser: if date.get_slash(): date.set_calendar(Date.CAL_JULIAN) - date.set_year(date.get_year()) # forces recalc + date.set_year(date.get_year() + 1) # year++ and forces recalc def invert_year(self, subdate): return (subdate[0], subdate[1], -subdate[2], subdate[3]) diff --git a/src/gen/lib/date.py b/src/gen/lib/date.py index 1690d3001..23776df84 100644 --- a/src/gen/lib/date.py +++ b/src/gen/lib/date.py @@ -922,13 +922,6 @@ class Date: """ if calendar == self.calendar: return - if self.get_slash(): - if (self.calendar == Date.CAL_JULIAN and - calendar == Date.CAL_GREGORIAN): - self.set_year(self.get_year() + 1) - elif (self.calendar == Date.CAL_GREGORIAN and - calendar == Date.CAL_JULIAN): - self.set_year(self.get_year() - 1) (year, month, day) = Date._calendar_change[calendar](self.sortval) if self.is_compound(): ryear = max(self.dateval[Date._POS_RYR], 1) diff --git a/src/gen/lib/test/date_test.py b/src/gen/lib/test/date_test.py index 59dfa53b9..ed9513825 100644 --- a/src/gen/lib/test/date_test.py +++ b/src/gen/lib/test/date_test.py @@ -301,6 +301,7 @@ def suite(): ("jan 1, 2000/1", "jan 1, 2001", False), ("jan 1, 2000/1", "jan 1, 2000/1", True), ("jan 1, 2000/1", "jan 14, 2001", True), + ("jan 1, 2000/1", "jan 1, 2001 (julian)", True), ("about 1984", "about 2005", False), ("about 1990", "about 2005", True), ("about 2007", "about 2006", True), @@ -372,6 +373,6 @@ def suite2(): return suite if __name__ == "__main__": - unittest.TextTestRunner().run(suite()) - unittest.TextTestRunner().run(suite2()) unittest.TextTestRunner().run(suite3()) + unittest.TextTestRunner().run(suite2()) + unittest.TextTestRunner().run(suite())