Date manupulation is still one of the most complex problems while developing and
it's a really nerve wracking work when developing in javascript. There is a very
lightweight and nice framework for that called Moment.js [http://momentjs.com].
They offer functions to parse, validate, manipulate and display