xsd2php-runtime
xsd2php-runtime copied to clipboard
Support negative DateInterval
Excuse the misspelled branch name, but the rest is pretty self explanatory!
ps. That file was mostly psr-2, but I see there are a couple of formatting changes that have come through. Let me know if you'd like them out of this PR.
Hi! Thanks for your contribution!
Are negative date intervals something standardized?
Asking since apparently is not supported by PHP.
Reasonable question to ask!
I can’t find a concrete answer, but I’ve encountered it more than once. That, and php’s DateInterval can natively represent a negative interval anyway.
Arguably a duration is a duration, regardless of direction so I can see it both ways. Thoughts?
There’s been some discussion in other projects too: https://github.com/moment/moment/issues/2408
Sorry for the long feedback loop, was pretty busy in the last days.
This can be ok in my opinion and thanks for finding other references to this negative interval behaviors.
But for such feature I think we need some tests to ensure does not get removed or broken in the future. Can you please?
Yep, sure.