Team:KULeuven/Tools/New Day/Date Retriever

From 2008.igem.org

(Difference between revisions)
m
m
Line 25: Line 25:
// Construct a Date object and return the result
// Construct a Date object and return the result
var date = new Date();
var date = new Date();
-
datesetFullYear(year, month, day);
+
date.setFullYear(year, month, day);
return date;
return date;
}
}
Line 32: Line 32:
function datePast(ndays) {
function datePast(ndays) {
var pastDate = new Date();
var pastDate = new Date();
-
pastDate.setDate(pageDate.getDate() - days);
+
pastDate.setDate(pageDate.getDate() - ndays);
return pageDate;
return pageDate;
}
}
Line 39: Line 39:
function dateFuture(ndays) {
function dateFuture(ndays) {
var futureDate = new Date();
var futureDate = new Date();
-
futureDate.setDate(pageDate.getDate() + days);
+
futureDate.setDate(pageDate.getDate() + ndays);
return futureDays;
return futureDays;
}
}

Revision as of 09:16, 31 July 2008

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