Datejs – Armed and Dangerous

datejs

Datejs is a ninja. Joking aside, Datejs is an open-source JavaScript library for handling dates. I almost want to say a veritable framework for handling dates. Is that all, you say? Yes, but dates can be a real headache for …

Datejs is a ninja. Joking aside, Datejs is an open-source JavaScript library for handling dates. I almost want to say a veritable framework for handling dates.

Is that all, you say? Yes, but dates can be a real headache for any self-respecting developer: validation and comparison of dates, daylight saving time and standard time, leap years, cultural/ location variations, not to mention the sensitivity of different Javascript engines on the market.

Framework

In this sense Datejs can save you dozens of hours of development time by sparing you from writing a zillion lines of code (especially if you’re still tinkering with IE6).

Like jQuery, each method gives you an object that can be linked with another; things are accomplished with ease – in a literal way, almost naturally:

Datejs gives a response to the validation engine by offering a “parser,” which is handy for checking a date entered manually or through a “date picker”:

Some nice features were adapted to JavaScript objects, like “number” — which Datejs has made into a close ally:

And location? Datejs is armed with knowledge of more than 150 cultures, which you can use on demand.

To conclude, the API is very well documented (but in English) and the installation is very simple.

Datejs is not exactly revolutionary but why go without it (it’s about 25 kb). It is essential in the management and display of dates on the client side.

Small, discreet and extremely effective — Datejs is indeed a ninja.

 KIM DOTNET

For more information:

http://www.datejs.com 

http://code.google.com/p/datejs/wiki/APIDocumentation 
http://www.datejs.com/2007/11/27/getting-started-with-datejs/