I've been using Date.js in my project and recently read a post that moment.js was superior.
However, I'm having trouble believing that it is simply due to the fact that it can't parse input like "5 days from now" to an n actual date.
My personal desire/requirements are that
Date.js does both. Moment.js seems to only do #2...
Am I missing something, or am I cool to use Date.js still?
Additionally...for my rails project. Is it better to format things server-side or client side? ie. I have a few things I'd like to format based on the relative date condition. (Like add a class if it's 10 days from now, or >0 days past now)...pros/cons of client/server side date parsing/manipulation?
You are correct. Moment.JS does not handle #2 .... only Date.js does.
As for server vs client... I tend to unload calculations to the client unless I am building a mobile app. In the end let the application/project determine where computation should occur.
It has been 8 years since the question asked. The situation has changed a bit.
momentjs has a web site and github has changes from (Oct 6, 2020). It has a sort of active development stage, when the original Datejs repository has been archived by the owner. Now there is DateJS: Evolved
project form abritinthebay that has the latest changes on (Dec 17, 2014)
Bottom line - momentjs
is still alive, when Datejs
is not.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With