Team:KULeuven/Tools/New Day/Date Retriever

From 2008.igem.org

(Difference between revisions)
m
m
Line 52: Line 52:
switch(dayOfWeek) {
switch(dayOfWeek) {
-
case 0: previousWeekFriday.setDate(pageDate().getDate() - 9); break;
+
case 0: previousWeekFriday = datePast(9); break;
default: previousWeekFriday.setDate(pageDate().getDate() - (dayOfWeek + 2)); break;
default: previousWeekFriday.setDate(pageDate().getDate() - (dayOfWeek + 2)); break;
}
}
Line 65: Line 65:
alert(dayOfWeek);
alert(dayOfWeek);
switch(dayOfWeek) {
switch(dayOfWeek) {
-
case 0: nextWeekMonday.setDate(pageDate().getDate() + 1); break;
+
case 0: nextWeekMonday = futureDate(1); break;
-
default: nextWeekMonday.setDate(pageDate().getDate() + (8 - dayOfWeek)); break;
+
default: nextWeekMonday = futureDate(8 - dayOfWeek); break;
}
}

Revision as of 10:14, 31 July 2008

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