Daily Archives: January 18, 2013

1 post

Add days, months and years in JavaScript

This JavaScript function has been updated to better handle various scenarios, please check the new version here:¬† In ASP.NET, you can easily use DateTime.AddDays(), DateTime.AddMonths(), or DateTime.AddyYears() function to get a new DateTime object, but in JavaScript, there is no such built-in function. Since it is very common you have to do some date calculation or validation in JavaScript, I decided to write my own JavaScript function to add days, months, and years to a […]