I have found a cool Javascript library for manipulating dates called datejs. It’s really simple to use and offers a lot of syntactic sugar (examples taken from their website)
// Add 3 days to Today Date.today().add(3).days(); // Is today Friday? Date.today().is().friday(); // Number fun (3).days().ago(); // 6 months from now var n = 6; n.months().fromNow();
It saves a lot of headaches