diff --git a/server/controller/Servicio/gustavoBazPrada.js b/server/controller/Servicio/gustavoBazPrada.js index bfd784b..230fd1b 100644 --- a/server/controller/Servicio/gustavoBazPrada.js +++ b/server/controller/Servicio/gustavoBazPrada.js @@ -29,7 +29,7 @@ const gustavoBazPrada = async (body) => { nombre: res[i].Usuario.nombre, licenciatura: res[i].Carrera.carrera, correo: res[i].correo, - fechaLiberacion: res[i].fechaLiberacion, + fechaLiberacion: validar.crearDDMMAAAA(res[i].fechaLiberacion), }); try { fs.unlinkSync(path); diff --git a/server/controller/Servicio/reporte.js b/server/controller/Servicio/reporte.js index 79f3b22..23a93fc 100644 --- a/server/controller/Servicio/reporte.js +++ b/server/controller/Servicio/reporte.js @@ -34,12 +34,13 @@ const reporte = async (body) => { nombre: res[i].Usuario.nombre, licenciatura: res[i].Carrera.carrera, correo: res[i].correo, - fehcaInicio: res[i].fechaInicio, - fechaFin: res[i].fechaFin, - fechaLiberacion: res[i].fechaLiberacion, + fechaInicio: validar.crearDDMMAAAA(res[i].fechaInicio), + fechaFin: validar.crearDDMMAAAA(res[i].fechaFin), + fechaLiberacion: validar.crearDDMMAAAA(res[i].fechaLiberacion), institucion: res[i].Programa.institucion, dependencia: res[i].Programa.dependencia, programa: res[i].Programa.programa, + profesor: res[i].profesor, clave: res[i].Programa.clavePrograma, status: res[i].Status.status, }); diff --git a/server/helper/validar.js b/server/helper/validar.js index 18af260..bbe0708 100644 --- a/server/helper/validar.js +++ b/server/helper/validar.js @@ -149,6 +149,17 @@ const isObjectEmpty = (obj) => { return true; }; +const crearDDMMAAAA = (date) => { + const fechaMoment = moment(date); + let ddmmaaaa = ''; + + if (fechaMoment.isValid()) + ddmmaaaa = `${fechaMoment.date()}/${ + fechaMoment.month() + 1 + }/${fechaMoment.year()}`; + return ddmmaaaa; +}; + module.exports = { validar, noValido, @@ -164,4 +175,5 @@ module.exports = { validarPreTermino, validarAccesibilidad, isObjectEmpty, + crearDDMMAAAA, };