Commit 1282480e by Billy Larru

generando fechas pares e impares

parent 9007476d
......@@ -240,9 +240,39 @@ function registrarRolPolicia() {
let hora_salida = $("#cboTipoRol option:selected").data('hora-salida');
debugger
let fechas = generarFechas(fecha_inicio, fecha_fin);
let fechas_rol;
switch (frecuencia_descripcion) {
case "PAR":
fechas_rol = fechas
.map(f => {
return {
number: f.split("/")[0],
fecha: f
}
})
.filter(f => f.number % 2 == 0)
.map(f => f.fecha);
break;
case "IMPAR":
fechas_rol = fechas
.map(f => {
return {
number: f.split("/")[0],
fecha: f
}
})
.filter(f => f.number % 2 == 1)
.map(f => f.fecha);
break;
case "DIARIO":
fechas_rol = fechas;
break;
}
let detalles_rol = [];
let numero = 1;
fechas
fechas_rol
.map((f) => {
let obj = {
fecha_entrada: `${f} ${hora_entrada}`,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment