Javascript date library

Published on 2024-12-01 by Raul

I've started working a lot with javascript recently; one of the issues that I regularly encountered was that the Date object was incomplete. I couldn't add a day to it and there were plenty of other things I thought missing.

So I started looking for a library to overcome all this. I've found it: called datejs, it adds fluent methods in jQuery-like synthax, for example:

Date.today().add(5).days();
Date.friday();
Date.january().first().monday()

I really love it; even though it's in Alpha1, I didn't encountered any issues so far.

LE: Turns out DateJS hasn't been updated in over 5 years, so I wouldn't recommend it. I've found Moment, which is appreciated in the community, lightweight, unit-tested.

The next runner-up was XDate, which is also worth a look.


Keep in touch


About

Hey there, I'm Raul, owner of CreativeCLR, a small consulting company.

Feel free to drop me any question you might have on this post using the comment section or the contact page.