forked from CTreffOS/ctreffos-webseite
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
28 lines (23 loc) · 702 Bytes
/
script.js
File metadata and controls
28 lines (23 loc) · 702 Bytes
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
function getMondays() {
var d = new Date(),
month = d.getMonth(),
mondays = [];
d.setDate(1);
// Get the first Monday in the month
while (d.getDay() !== 1) {
d.setDate(d.getDate() + 1);
}
// Get all the other Mondays in the month
while (d.getMonth() === month) {
mondays.push(new Date(d.getTime()));
d.setDate(d.getDate() + 7);
}
return mondays;
}
function setMeeting() {
var meeting = getMondays()[3];
meeting = ('' + meeting).split(' ');
meeting = meeting[0] + ' ' + meeting[1] + ' ' + meeting[2] + ' ' + meeting[3];
var node = document.getElementById('nextmeeting');
node.innerHTML = meeting + node.innerHTML;
}