From b7117e1caecc2b4f4edf9d0807987ffbd4f778e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Andr=C3=A9s?= Date: Tue, 24 May 2022 16:15:19 +0200 Subject: [PATCH] =?UTF-8?q?#3945=20Orden=20d=C3=ADas=20de=20la=20semana=20?= =?UTF-8?q?incorrectos?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- js/clockIn.js | 32 ++++++++++++++------------------ 1 file changed, 14 insertions(+), 18 deletions(-) diff --git a/js/clockIn.js b/js/clockIn.js index ae7f839..909c2bf 100644 --- a/js/clockIn.js +++ b/js/clockIn.js @@ -93,7 +93,7 @@ function getInfo() { } function printTimetable(timetable) { - var listWeekName = printWeek(); + var listWeekName = weekDays(); var dated = new Date(); dated.setDate(dated.getDate() - 6); @@ -172,25 +172,21 @@ function printTotalHours(timetable) { } -function printWeek() { - var listWeekName = []; - var curr = new Date(); - for (var i = 0; i < 7; i++) { - curr.setDate(curr.getDate() - 1); - listWeekName.push(weekDays[curr.getDay()]); - } - return listWeekName; +function weekDays() { + var weekDays = [ + 'Domingo', + 'Lunes', + 'Martes', + 'Miércoles', + 'Jueves', + 'Viernes', + 'Sábado' + ]; + + return weekDays; } -var weekDays = [ - 'Domingo', - 'Sábado', - 'Viernes', - 'Jueves', - 'Miércoles', - 'Martes', - 'Lunes' -]; + function printErrores(errores) { var error ='';