Ignore:
Timestamp:
01/24/24 17:42:28 (8 months ago)
Author:
darsov2 <62809499+darsov2@…>
Branches:
master
Children:
0f5aa27
Parents:
5528b99
Message:

prefinal fixes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • frontend/src/Components/HotelEdit/ReservationListing.js

    r5528b99 r07f4e8b  
    33
    44const ReservationListing = (props) => {
     5
     6    const dateFormatter = (str) => {
     7        const inputDate = new Date(str);
     8
     9        const options = {
     10            year: '2-digit',
     11            month: '2-digit',
     12            day: '2-digit',
     13        };
     14
     15        return inputDate.toLocaleString('de-DE', options);
     16    }
     17
    518    return(
    619        <>
     
    1528                    <Col md={8} className="d-flex flex-column justify-content-start ps-5">
    1629                        <h3 style={{fontWeight: "bold"}} className={'text-start'}>Резервација за:</h3>
    17                         <h4 className={'text-start'}>{props.data.hotelRoom.hotelRoomName}</h4>
     30                        {props.type === 'hotel' && <h4 className={'text-start'}>{props.data.hotelRoom.hotelRoomName}</h4>}
     31                        {props.type === 'restaurant' && <h4 className={'text-start'}>{'Маса за ' + props.data.restaurantsTable.noSeats}</h4>}
     32                        {props.type === 'transport' && <h4 className={'text-start'}>{props.data.transportRoute.from + ' ' + props.data.transportRoute.to}</h4>}
     33                        {props.type === 'transport' && <h4 className={'text-start'}>{props.data.noSeats + ' ' + 'патници'}</h4>}
    1834                        <h4 className={'text-start'}>{props.data.user.name + ' ' + props.data.user.surname}</h4>
    19                         <h5 className={'text-start'}>{props.data.dateFrom + ' - ' + props.data.dateTo}</h5>
     35                        {props.type !== 'transport' && <h5
     36                            className={'text-start'}>{dateFormatter(props.data.dateFrom) + ' - ' + dateFormatter(props.data.dateTo)}</h5>}
    2037                    </Col>
    2138                    <Col md={4} className="d-flex flex-column justify-content-center align-content-center">
    22                         <h3>Вкупна цена: <br></br>{props.data.hotelRoom.price}$</h3>
     39                        {props.type === 'hotel' && <h3>Вкупна цена: <br></br>{props.data.hotelRoom.price}$</h3>}
    2340                    </Col>
    2441                </Row>
Note: See TracChangeset for help on using the changeset viewer.