Team:KULeuven/Tools/New Day/Date Retriever

From 2008.igem.org

(Difference between revisions)
m
m
Line 28: Line 28:
var date = new Date();
var date = new Date();
date.setFullYear(year, month, day);
date.setFullYear(year, month, day);
-
alert(date.getMonth());
+
 
return date;
return date;
}
}
Line 36: Line 36:
var pastDate = new Date();
var pastDate = new Date();
ntime = pageDate().getTime();
ntime = pageDate().getTime();
-
alert(ntime);
+
alert(ntime instanceof String);
-
ntime = ntime + ndays*86400;
+
ntime = ntime - ndays*86400;
pastDate.setTime(ntime);
pastDate.setTime(ntime);
-
alert(pastDate.toGMTString());
+
 
return pastDate;
return pastDate;
}
}
Line 48: Line 48:
futureDate.setDate(pageDate().getDate());
futureDate.setDate(pageDate().getDate());
futureDate.setDate(futureDate.getDate() + ndays);
futureDate.setDate(futureDate.getDate() + ndays);
-
alert(futureDate.toGMTString());
+
 
return futureDate;
return futureDate;
}
}
Line 97: Line 97:
URL += date.getDate();
URL += date.getDate();
URL += '_';
URL += '_';
-
URL += monthNames[date.getMonth() - 1];
+
URL += monthNames[date.getMonth()];
URL += '_';
URL += '_';
URL += date.getFullYear();
URL += date.getFullYear();

Revision as of 17:29, 1 August 2008

<< return to notebook return to homepage >>
< previous friday ← yesterday tomorrow → next monday >