formateo de fechas y eliminar impresiones innecesarias

This commit is contained in:
Mariela 2022-08-26 17:13:18 -06:00
parent 5a2f0846d8
commit 1b99458b7d
4 changed files with 6 additions and 21 deletions

View File

@ -14,8 +14,6 @@ export class ReservationsService {
) {} ) {}
create(reservation: ReservationDocument) { create(reservation: ReservationDocument) {
console.log(reservation);
return this.reservationModel.create(reservation); return this.reservationModel.create(reservation);
} }

View File

@ -1,5 +1,5 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="es">
<head> <head>
<meta charset="utf-8" /> <meta charset="utf-8" />
<title>Katoikia</title> <title>Katoikia</title>

View File

@ -13,8 +13,8 @@ export const AppFooter = (props) => {
height="20" height="20"
className="mr-2" className="mr-2"
/> />
by por
<span className="font-medium ml-2">PrimeReact</span> <span className="font-medium ml-2">Deimos</span>
</div> </div>
); );
}; };

View File

@ -49,7 +49,6 @@ const Reservations = () => {
const [reservationDialog, setReservationDialog] = useState(false); const [reservationDialog, setReservationDialog] = useState(false);
async function tenantsList(id) { async function tenantsList(id) {
await fetch(`http://localhost:4000/user/findTenants/${id}`, await fetch(`http://localhost:4000/user/findTenants/${id}`,
{ method: 'GET' }) { method: 'GET' })
@ -148,8 +147,6 @@ const Reservations = () => {
} else if (_reservation.status == '0') { } else if (_reservation.status == '0') {
_reservation.status_text = 'Inactivo'; _reservation.status_text = 'Inactivo';
} }
console.log(_reservation)
fetch('http://localhost:4000/reservation/createReservation/', { fetch('http://localhost:4000/reservation/createReservation/', {
cache: 'no-cache', cache: 'no-cache',
method: 'POST', method: 'POST',
@ -174,19 +171,12 @@ const Reservations = () => {
setReservationDialog(false) setReservationDialog(false)
}) })
} else { } else {
setSubmitted(true); setSubmitted(true);
} }
} }
const actionsReservation = (rowData) => { const actionsReservation = (rowData) => {
return ( return (
<div className="actions"> <div className="actions">
<Button <Button
@ -199,8 +189,6 @@ const Reservations = () => {
); );
}; };
const confirmDeleteReservation = (reservation) => { const confirmDeleteReservation = (reservation) => {
setReservation(reservation); setReservation(reservation);
setDeleteReservationDialog(true); setDeleteReservationDialog(true);
@ -267,7 +255,6 @@ const Reservations = () => {
); );
}; };
const reservationDialogFooter = ( const reservationDialogFooter = (
<> <>
<Button <Button
@ -432,7 +419,7 @@ const Reservations = () => {
} }
function formatDateString(dateString) { function formatDateString(dateString) {
const [date, time] = dateString.split('T'); let date = new Date(dateString).toLocaleDateString("es-CL");
return date; return date;
} }
@ -587,7 +574,7 @@ const Reservations = () => {
autoFocus autoFocus
min={new Date().toJSON().split('T')[0]} min={new Date().toJSON().split('T')[0]}
type="date" type="date"
lang='es' lang='es-CL'
value={reservation.date} value={reservation.date}
className={classNames({ className={classNames({
'p-invalid': submitted && (reservation.date === '' 'p-invalid': submitted && (reservation.date === ''