' In JavaScript, il primo giorno della settimana (0) significa "Domenica", anche se alcuni paesi del mondo considerano il "primo giorno della settimana" il "lunedi'"
' E possibile utilizzare una matrice di nomi e getDay()restituire il giorno della settimana https://www.w3schools.com/js/tryit.asp?filename=tryjs_date_weekday <!DOCTYPE html> <html> <body> <h2>JavaScript getDay()</h2> <p>The getDay() method returns the weekday as a number:</p> <p>You can use an array to display the name of the weekday:</p> <p id="demo"></p> <script> var d = new Date(); var days = ["Domenica","Lunedi","Martedi","Mercoledi","Giovedi","Venerdi","Sabato"]; document.getElementById("demo").innerHTML = days[d.getDay()]; </script> </body> </html> |