Team:KULeuven/Tools/New Day/Date Retriever

From 2008.igem.org

(Difference between revisions)
m
m
Line 35: Line 35:
function datePast(ndays) {
function datePast(ndays) {
var pastDate = new Date();
var pastDate = new Date();
-
pastDate.setDate(pageDate().getDate() - ndays);
+
pastDate.setDate(pageDate().getDate() - parseInt(ndays));
-
alert(pageDate().getDate());
+
return pastDate;
return pastDate;
}
}
Line 43: Line 42:
function dateFuture(ndays) {
function dateFuture(ndays) {
var futureDate = new Date();
var futureDate = new Date();
-
futureDate.setDate(pageDate().getDate() + ndays);
+
futureDate.setDate(pageDate().getDate() - parseInt(ndays));
return futureDate;
return futureDate;
}
}

Revision as of 08:35, 1 August 2008

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