Kronos is a small library that aims to take the mystery out of working with dates and times in JavaScript.
Kronos is alpha-quality right now and is being aggressively developed. You’re encouraged to play with it and hack on it all you like and contribute to the project, but it’s not yet production-ready.
Kronos can be run in Node or in a web browser as an AMD module.
- Create dates & times any way you would with the standard
Date
class, and then some - Arithmetic: add and subtract times from each other; get the difference between two times
- Better syntax for timeouts and intervals, with optional conditionals
- Chaining: any Kronos operation that returns another date/time can be chained
- Relative date formatting
- Live DOM updates for relative times
A full test suite is available, with all tests written in Mocha and CoffeeScript.
mocha tests
- Real time zone support backed by
tzinfo
database - Event system
- i18n
Kronos is distributed under the MIT license. For a copy of the license, see LICENSE.txt
.