Created
March 30, 2011 01:24
-
-
Save scottharvey/893695 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function addWeeks(myDate, weeks) { | |
days = weeks * 7; | |
return new Date(myDate.getTime() + days*24*60*60*1000); | |
} | |
date = new Date(Date.parse('Mar 28, 2011')); | |
addWeeks(date, 1); | |
// This is returning Sun Apr 03 when it should be Mon Apr 04 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment