csv en reservaciones
This commit is contained in:
parent
7b7a3f27d2
commit
cc9a83d550
Binary file not shown.
After Width: | Height: | Size: 29 KiB |
|
@ -446,6 +446,8 @@ const App = () => {
|
|||
<>
|
||||
|
||||
<Route path="/login" exact component={LogInUser} />
|
||||
<Route path="/crud" component={Crud} />
|
||||
|
||||
</>
|
||||
|
||||
)
|
||||
|
|
|
@ -6,11 +6,11 @@ export const AppFooter = (props) => {
|
|||
<img
|
||||
src={
|
||||
props.layoutColorMode === 'light'
|
||||
? 'assets/layout/images/logo-dark.svg'
|
||||
? 'images/deimos-logo.png'
|
||||
: 'assets/layout/images/logo-white.svg'
|
||||
}
|
||||
alt="Logo"
|
||||
height="20"
|
||||
height="40"
|
||||
className="mr-2"
|
||||
/>
|
||||
por
|
||||
|
|
|
@ -182,8 +182,17 @@ const Reservations = () => {
|
|||
}
|
||||
|
||||
const exportCSV = () => {
|
||||
//
|
||||
if (selectedReservations) {
|
||||
while (dt.current.props.value.length > 0)
|
||||
dt.current.props.value.pop();
|
||||
let n=0;
|
||||
for (let n = 0; n < selectedReservations.length; n++){
|
||||
dt.current.props.value.push(selectedReservations[n]);
|
||||
}
|
||||
}
|
||||
dt.current.exportCSV();
|
||||
selectedReservations.current.exportCSV();
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
@ -238,8 +247,9 @@ const Reservations = () => {
|
|||
<Button
|
||||
label="Nueva Reservación"
|
||||
icon="pi pi-plus"
|
||||
className="p-button-success mr-2"
|
||||
className="p-button-primary mr-2"
|
||||
onClick={openNewReservation}
|
||||
|
||||
/>
|
||||
<Button
|
||||
label="Eliminar"
|
||||
|
@ -418,9 +428,9 @@ const Reservations = () => {
|
|||
}
|
||||
|
||||
function validationIsReservation() {
|
||||
if(reservation.date && reservation.time && areaId){
|
||||
if (reservation.date && reservation.time && areaId) {
|
||||
let date1 = new Date(reservation.date).toJSON().split('T')[0];
|
||||
let date2 = date1.split('-')[2] + '-' + date1.split('-')[1] + '-' +date1.split('-')[0];
|
||||
let date2 = date1.split('-')[2] + '-' + date1.split('-')[1] + '-' + date1.split('-')[0];
|
||||
|
||||
let booked = reservations.filter(item => item.common_area_id == areaId
|
||||
&& item.date == date2
|
||||
|
@ -436,9 +446,9 @@ const Reservations = () => {
|
|||
}
|
||||
|
||||
function validationIsSameUser() {
|
||||
if(reservation.date && tenantId && areaId){
|
||||
if (reservation.date && tenantId && areaId) {
|
||||
let date1 = new Date(reservation.date).toJSON().split('T')[0];
|
||||
let date2 = date1.split('-')[2] + '-' + date1.split('-')[1] + '-' +date1.split('-')[0];
|
||||
let date2 = date1.split('-')[2] + '-' + date1.split('-')[1] + '-' + date1.split('-')[0];
|
||||
|
||||
let booked = reservations.filter(item => item.common_area_id == areaId
|
||||
&& item.date == date2
|
||||
|
@ -499,6 +509,7 @@ const Reservations = () => {
|
|||
headerStyle={{ width: '3rem' }}
|
||||
></Column>
|
||||
<Column
|
||||
exportFilename="Date"
|
||||
field="date"
|
||||
sortable
|
||||
header={headerDate}
|
||||
|
|
Loading…
Reference in New Issue