Handle negative date intervals where HotDateInterval wasn't exactly the same as DateInterval
Handle negative date intervals where HotDateInterval wasn't exactly the same as DateInterval

We were getting the following error:
Message: DateInterval::__construct( Unknown or bad format (P-30D)

There are two ways to fix this:
1) using the $invert property of the interval
2) using DateTime::sub() instead of DateTime::add()

The choice between the two is a bit arbitrary, but I thought $invert keeps the code a little simpler with a single obvious return path.

Also, another possible way to handle this would be to do DateTime::sub() for the SwatDate::subtract*() methods, and DateTime::add() for the SwatDate::add*() methods, but I think it's better to handle both cases in the SwatDate::add*() methods so that we don't have to write code that checks if the value is negative in order to call the correct SwatDate method and instead handle it internally.



svn commit r81842

silverorange/swat,silverorange/swat