Closed mxsasha closed 9 months ago
Thank you for reporting this issue. Leap years did fail since it just added a 1 to the year value without accounting for these leap days. It has been improved by using the relativeDelta
function on the dateutil
package which does account for these leap years,
Your proposed solution would solve the breaking issue with the value error it would not be entirely correct, since it would count a year later in a leap year a day short. However it made it easier to come up with the solution that has been added now so thank you for offering a proposed solution.
The expiry check fails to run any expiry check on a leap day, like today: https://github.com/DigitalTrustCenter/sectxt/blob/27d8524/sectxt/__init__.py#L280
This should probably usenow + datetime.timedelta(years=1)
The correct approach is probably
expiry_line_date - datetime.datetime.now() <= datetime.timedelta(days=365)
.Quick test (executed on leap day):