Merge pull request '#3945 Orden días de la semana incorrectos' (#8) from test into master
gitea/worker-time-control/pipeline/head This commit looks good Details

Reviewed-on: #8
This commit is contained in:
Carlos Andrés 2022-05-24 14:19:18 +00:00
commit d86a7aa71a
1 changed files with 14 additions and 18 deletions

View File

@ -93,7 +93,7 @@ function getInfo() {
} }
function printTimetable(timetable) { function printTimetable(timetable) {
var listWeekName = printWeek(); var listWeekName = weekDays();
var dated = new Date(); var dated = new Date();
dated.setDate(dated.getDate() - 6); dated.setDate(dated.getDate() - 6);
@ -172,25 +172,21 @@ function printTotalHours(timetable) {
} }
function printWeek() { function weekDays() {
var listWeekName = []; var weekDays = [
var curr = new Date(); 'Domingo',
for (var i = 0; i < 7; i++) { 'Lunes',
curr.setDate(curr.getDate() - 1); 'Martes',
listWeekName.push(weekDays[curr.getDay()]); 'Miércoles',
} 'Jueves',
return listWeekName; 'Viernes',
'Sábado'
];
return weekDays;
} }
var weekDays = [
'Domingo',
'Sábado',
'Viernes',
'Jueves',
'Miércoles',
'Martes',
'Lunes'
];
function printErrores(errores) { function printErrores(errores) {
var error =''; var error ='';