XZise added a comment.
Okay I've got a question: What would be the 31st March + 1 month? Would it be the last day in April or the 1 day in May? Or like PHP which selects the day in the month after that (so 31 May).
This doesn't affect the calculation of the difference however. That would be probably easier than the calculation as you could simply add the month difference and years difference multiplied by 12. So something like:
delta = (date2.month - date1.month) % 12 + (date2.year - date1.year) * 12 return -delta if date2 < date1 else delta
TASK DETAIL https://phabricator.wikimedia.org/T73124
REPLY HANDLER ACTIONS Reply to comment or attach files, or !close, !claim, !unsubscribe or !assign <username>.
EMAIL PREFERENCES https://phabricator.wikimedia.org/settings/panel/emailpreferences/
To: XZise Cc: Xqt, Legoktm, jayvdb, Multichill, XZise, pywikipedia-bugs