Roundup Tracker - Issues

Message7580

Author rouilj
Recipients ThomasAH, ber, rouilj, schlatterbeck
Date 2022-06-16.23:17:54
Message-id <1655421474.57.0.20123259984.issue2550858@roundup.psfhosted.org>
In-reply-to
It looks like the current code acts the same as gnu date:

1 month adds the number of days in month of starting date
take that date as the new starting date and add another current month's
worth of days.

so 2022-01-29 + 1 month adds 31 days -> 2022-03-01,
   2022-01-29 + 2 months adds 31 + 28 days (non-leap year) -> 2022-03-29

   2020-02-10 + 1 month (leap year) + 29 days

now when going backwards it subtracts the number of days in the previous month:

   2022-05-29 - 1 month subtracts 30 days (April) -> 2022-04-29

Similarly:

   2022-01-10 - 1 month subtracts 31 days (dec) -> 2021-12-10

So I claim roundup is doing a right thing here at least.

Thomas I think your desired test cases are handled by changing to:

  adding the number of days in the next month
or
  subtracting the days in the current month?

Is that less confusing/more desirable or more correct according to some authority?
History
Date User Action Args
2022-06-16 23:17:54rouiljsetmessageid: <1655421474.57.0.20123259984.issue2550858@roundup.psfhosted.org>
2022-06-16 23:17:54rouiljsetrecipients: + rouilj, schlatterbeck, ber, ThomasAH
2022-06-16 23:17:54rouiljlinkissue2550858 messages
2022-06-16 23:17:54rouiljcreate