mozilla-b2g/gaia — pull request #11962 by Protonk (2013-09-05 17:21:10+00:00)
Title: Bug 909343 [Clock] Refactor Date Math Utilities

Refactor `utils.js` to provide methods for:

* Conversion to milliseconds from objects with duration values, e.g. `{hours: 4, seconds: 12}` (for any combination of hours, minutes, seconds, etc.
* Conversion from millisecond interval to object with duration values.
* Safely add millisecond or objects with duration values to `Date` objects or millisecond counts
* Add tests for datemath conversions