silverorange/swat — pull request #30 by isaacgrant (2014-05-30 21:52:49+00:00)
Title: Add SwatString::getTimePeriodParts()

Breaks getHumanReadableTimePeriodParts() into two methods:
* getTimePeriodParts() keeps all the logic of defining the $interval_parts you want returned, and calculating them.
* getHumanReadableTimePeriodParts() is rewritten to use getTimePeriodParts() internally, but maintain old behaviour.

Using getTimePeriodParts() means you can keep the benefits over a straight DateInterval, without being forced to use getHumanReadableTimePeriodParts() strings.