You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@jajadinimueter (assuming you are the same here and on LP - seems likely):
Thanks for reporting this. This is an order of operations issue, and is the expected behavior. The problem is that any addition between a datetime and a relativedelta has to return a valid date. So in your example:
So the first operation resolves to datetime.date(2014, 1, 31), the second one resolves to datetime.date(2014, 2, 28) (because Feb 31 is not a valid date), and the third resolves to datetime.date(2014, 3, 28). I'm not sure what your specific use case is (e.g. why you want to use 3 relativedeltas instead of one), but in your example, you can fix it by doing all the relativedelta addition first:
Migrated from launchpad issue #1292043.
Quoting Florian Müller on 2014-03-13
The text was updated successfully, but these errors were encountered: