blob: 2a4460c51b59746ea6826cae00c0cedc9e2abe9d [file] [log] [blame]
Andreu Huguetf4581a42020-09-17 13:33:44 +02001let hores = [], newhour;
2for (let h = 8; h < 22; ++h) {
3 newhour = "";
4 if (h < 10) newhour += "0";
5 newhour += h.toString();
6
7 hores.push(newhour + ":00");
8 hores.push(newhour + ":30");
9}
10
11hores.forEach(hora => {
12 let column = 1;
13 let td = $("td:contains(" + hora + ")").next();
14
15 while (td.text().indexOf(hora) == -1) {
16
17 if (td.text().indexOf("CDATA") == -1) {
18 let aula = $("#day_main th")[column].textContent.trim();
19 let durada = parseInt(td.attr("rowspan"))*30;
20
21 console.log(td.text()
22 + ", " + hora
23 + ", " + durada + "mins"
24 + ", " + aula);
25 }
26
27 td = td.next();
28 ++column;
29 }
30});