-
Notifications
You must be signed in to change notification settings - Fork 1
/
script.js
32 lines (30 loc) · 1019 Bytes
/
script.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
window.onload = function() {
var d = new Date();
var weekday = new Array(7);
weekday[0] = "sunday";
weekday[1] = "monday";
weekday[2] = "tuesday";
weekday[3] = "wednesday";
weekday[4] = "thursday";
weekday[5] = "friday";
weekday[6] = "saturday";
var n = d.getDay();
hidePreviousDays(n);
function hidePreviousDays(currentDayInteger) {
if (window.innerWidth>1046) { //desktop
document.getElementById("saturday").style.display='none';
document.getElementById("sunday").style.display='none';
if (currentDayInteger!=6) {
for (var i=0; i < currentDayInteger; i++) {
document.getElementById(weekday[i]).style.display='none';
}
}
} else { //mobile
for (var i=0; i < 7; i++) {
if (i!=currentDayInteger) {
document.getElementById(weekday[i]).style.display='none';
}
}
}
}
}