Dani Vilardell | d4f2c90 | 2020-09-23 13:54:19 +0200 | [diff] [blame] | 1 | |
| 2 | function completaHTML() { |
| 3 | document.getElementById("data").innerHTML = data; |
| 4 | var trobat = false; |
| 5 | for (i = 0; i < dataHorarisAlumne.length; i++) { |
Dani Vilardell | 824ec33 | 2020-09-23 16:00:40 +0200 | [diff] [blame] | 6 | var h = dataHorarisAlumne[i].hora[hora_actual.getDay()].split(":"); |
Dani Vilardell | d4f2c90 | 2020-09-23 13:54:19 +0200 | [diff] [blame] | 7 | var hAct = hora_actual.getHours() - 1; |
Dani Vilardell | d4f2c90 | 2020-09-23 13:54:19 +0200 | [diff] [blame] | 8 | if(hAct < 10) hAct = "0" + hAct; |
| 9 | if(h[0] == hAct) { |
| 10 | trobat = true; |
| 11 | document.getElementById("assignatura").innerHTML = dataHorarisAlumne[i].nom; |
| 12 | document.getElementById("aula").innerHTML = "Aula " + dataHorarisAlumne[i].aula; |
| 13 | } |
| 14 | } |
| 15 | if(!trobat) { |
| 16 | document.getElementById("assignatura").innerHTML = "No tens cap assignatura ara mateix de les que curses"; |
| 17 | } |
| 18 | |
| 19 | } |