Roundup Tracker - Issues

Message7551

Author schlatterbeck
Recipients rouilj, schlatterbeck
Date 2022-06-01.09:27:12
Message-id <1654075632.31.0.610948841467.issue2551208@roundup.psfhosted.org>
In-reply-to
Looks like the Interval class *tries* to do the right thing by preserving the semantics of a month (and year, see below) but fails when the next/prev month doesn't have this particular day (the 31st).

So it also fails in leap years for the same reason:
>>> from roundup import date
>>> d = date.Date ('2024-02-29')
>>> d + date.Interval ('+1y')
<Date 2025-03-01.00:00:00.000>
>>> d + date.Interval ('-1y')
<Date 2023-03-01.00:00:00.000>

Turns out this may be seen as a bug of the Date / Interval implementation and not of the calendar?
Should we try to fix it there?
Looks like there are no tests for these corner cases and we might rule that the behavior was undefined before?
History
Date User Action Args
2022-06-01 09:27:12schlatterbecksetmessageid: <1654075632.31.0.610948841467.issue2551208@roundup.psfhosted.org>
2022-06-01 09:27:12schlatterbecksetrecipients: + schlatterbeck, rouilj
2022-06-01 09:27:12schlatterbecklinkissue2551208 messages
2022-06-01 09:27:12schlatterbeckcreate