Tempus is designed to be a full replacement
to the Date class inside Javascript, to solve the
frustration of missing features and broken functionality. Tempus
offers over 230 methods ranging from string methods to date maths
and assertions to iterators, all packed into a tiny
4.5kb (minified and gzipped) package.
There is a lot of useful stuff packed into Tempus, you can have a look at the detailed overview for loads more detail on this, view the documentation, browse the api or even read the blog for tips and tutorials. Tempus has big aims, here are some of the things that make it awesome:
Tempus is loaded on this page!
Just open up your inspector and switch to the Console tab and you'll be able to try Tempus right away. Start by typing:
var date = new Tempus();
Chainable:
all date methods have chainable alternatives, for example
date.day(1).month(12)
Modular: In addition to "Core" you can download the Timer and Interval modules.
Tiny: core is just 4.5kb in production, but the full package is still less than 7kb small!
Well documented: loads of docs, and full api docs are available on this site, as well as tutorials on the blog
Timezone support: able to set and get timezone info, including fetching the local timezone info.
Math methods:
all date methods support math, and are chainable, like
date.addMonth(2)
Assertion methods:
dates can be queried for equality, using assertion methods like
isBefore()
Ordinals:
ordinal methods like ampm() and ordinalDate()
allow for strings like '12th', or '2pm'
Extensible: Tempus can be extended in many ways, add new parsers, modules or changing the locale.
Better formatting:
new toString methods, and toString can take a format
(toString('%Y-%m-%d'))
A really useful replacement for setTimeout/
setInterval with Tempus.Timer
… Even more: There is loads of stuff to look at, just come have a look at the docs