Week
function Formatweek (n) {
Let mydate = new Date ();
Let Theday=mydate.getday ()
Let week=[' Monday ', ' Tuesday ', ' Wednesday ', ' Thursday ', ' Friday ', ' Saturday ', ' Sunday '
Let Year=mydate.getfullyear ();
Let Month=mydate.getmonth () +1;
Let Day=mydate.getdate ();
return Week[n]
}
Date
Function Formatday (adddaycount) {
Let mydate = new Date ();
mydate.setdate (Mydate.getdate () +adddaycount);// Set the current date plus days (minus days)
Let y = mydate.getfullyear ();
Let M = Mydate.getmonth () +1;
Let d = mydate.getdate ();
return y+ "year" +m+ "month" +d+ "Day";
}
for (let i=0;i<7;i++) {
Let mydate = new Date ();
Let Theday=mydate.getday ()
if (i<theday) {
if (i==theday-1) {
document.write (Formatday (i-(theDay-1)) + ' Today ' + ' ... ')
}else{
document.write (Formatday (i-(theDay-1)) +formatweek (i) + ' ... ')
}
}else {
document.write (Formatday (i-(theDay-1)) +formatweek (i) + ' ... ')
}
}
JavaScript gets this week's date