Andreu Huguet | f4581a4 | 2020-09-17 13:33:44 +0200 | [diff] [blame] | 1 | let hores = [], newhour; |
| 2 | for (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 | |
| 11 | hores.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 | }); |