Skip to content

Instantly share code, notes, and snippets.

@scottharvey
Created March 30, 2011 01:24
Show Gist options
  • Save scottharvey/893695 to your computer and use it in GitHub Desktop.
Save scottharvey/893695 to your computer and use it in GitHub Desktop.
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