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(); | ||
- | + | 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() - | + | 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() + | + | 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 > |