TimeDelta_or_None fails for small negative times where the hours component is -00, due to -0 not being preserved through the string to int conversion. The check for negativity needs to be based on the original input, not <0 after the int conversion on the hours component.
The function does appear to work correctly for negative values where the hours component is not 0.
I have attached a patch which addresses these values and adds doctests around the 00:00:00.
Hopefully this is sufficient, please let me know if this needs improving before accepting.
thanks very much,
Log in to post a comment.