mirror of
https://github.com/tomru/pfadi-bussle.git
synced 2026-03-04 15:07:13 +01:00
use dateRange formatter in FE
This commit is contained in:
@@ -7,7 +7,7 @@ import { AdditionalCost, Bill } from '../../../../db/bill'
|
|||||||
import { Booking } from '../../../../db/booking'
|
import { Booking } from '../../../../db/booking'
|
||||||
import { BILL_STATUS, MILAGE_TARIFS } from '../../../../db/enums'
|
import { BILL_STATUS, MILAGE_TARIFS } from '../../../../db/enums'
|
||||||
import { getMilageMax } from '../../../../db/index'
|
import { getMilageMax } from '../../../../db/index'
|
||||||
import { dateFormatFrontend } from '../../../../helpers/date'
|
import { daysFormatFrontend } from '../../../../helpers/date'
|
||||||
import { getBillTotal } from '../../../../helpers/bill'
|
import { getBillTotal } from '../../../../helpers/bill'
|
||||||
import { getBookingStatus } from '../../../../helpers/booking'
|
import { getBookingStatus } from '../../../../helpers/booking'
|
||||||
import withSession, {
|
import withSession, {
|
||||||
@@ -181,8 +181,7 @@ export default function BookingBillPage({
|
|||||||
<form className="form" onSubmit={onSubmit}>
|
<form className="form" onSubmit={onSubmit}>
|
||||||
<div>
|
<div>
|
||||||
<strong>Buchungszeitraum:</strong>{' '}
|
<strong>Buchungszeitraum:</strong>{' '}
|
||||||
{dateFormatFrontend(new Date(booking.startDate))} -{' '}
|
{daysFormatFrontend(booking.days)}
|
||||||
{dateFormatFrontend(new Date(booking.endDate))}
|
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<strong>Bucher:</strong> {booking.booker.name}
|
<strong>Bucher:</strong> {booking.booker.name}
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import withSession, {
|
|||||||
import { getServerSideBooking } from '../../../../lib/getServerSideProps'
|
import { getServerSideBooking } from '../../../../lib/getServerSideProps'
|
||||||
import { Booking } from '../../../../db/booking'
|
import { Booking } from '../../../../db/booking'
|
||||||
import { getBookingStatus } from '../../../../helpers/booking'
|
import { getBookingStatus } from '../../../../helpers/booking'
|
||||||
import { dateFormatFrontend } from '../../../../helpers/date'
|
import { daysFormatFrontend } from '../../../../helpers/date'
|
||||||
import { BOOKING_STATUS } from '../../../../db/enums'
|
import { BOOKING_STATUS } from '../../../../db/enums'
|
||||||
|
|
||||||
export const getServerSideProps: GetServerSideProps = withSession(
|
export const getServerSideProps: GetServerSideProps = withSession(
|
||||||
@@ -83,9 +83,7 @@ export default function ShowBookingAdmin({
|
|||||||
<h2 className="text-3xl">Buchung {booking.uuid}</h2>
|
<h2 className="text-3xl">Buchung {booking.uuid}</h2>
|
||||||
<Calendar start={booking.startDate} end={booking.endDate} />
|
<Calendar start={booking.startDate} end={booking.endDate} />
|
||||||
<div>
|
<div>
|
||||||
<strong>Buchungszeitraum:</strong>{' '}
|
<strong>Buchungszeitraum:</strong> {daysFormatFrontend(booking.days)}
|
||||||
{dateFormatFrontend(new Date(booking.startDate))} -{' '}
|
|
||||||
{dateFormatFrontend(new Date(booking.endDate))}
|
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<strong>Bucher:</strong> {booking.booker.name}
|
<strong>Bucher:</strong> {booking.booker.name}
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import Header from '../../../components/header'
|
|||||||
import { getServerSideBooking } from '../../../lib/getServerSideProps'
|
import { getServerSideBooking } from '../../../lib/getServerSideProps'
|
||||||
import { Booking } from '../../../db/booking'
|
import { Booking } from '../../../db/booking'
|
||||||
import { BOOKING_STATUS } from '../../../db/enums'
|
import { BOOKING_STATUS } from '../../../db/enums'
|
||||||
import { dateFormatFrontend } from '../../../helpers/date'
|
import { daysFormatFrontend } from '../../../helpers/date'
|
||||||
import { getBookingStatus } from '../../../helpers/booking'
|
import { getBookingStatus } from '../../../helpers/booking'
|
||||||
|
|
||||||
export const getServerSideProps = getServerSideBooking
|
export const getServerSideProps = getServerSideBooking
|
||||||
@@ -64,9 +64,7 @@ export default function ShowBooking({
|
|||||||
<strong>Buchungsstatus:</strong> {getBookingStatus(booking.status)}
|
<strong>Buchungsstatus:</strong> {getBookingStatus(booking.status)}
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<strong>Buchungszeitraum:</strong>{' '}
|
<strong>Buchungszeitraum:</strong> {daysFormatFrontend(booking.days)}
|
||||||
{dateFormatFrontend(new Date(booking.startDate))} -{' '}
|
|
||||||
{dateFormatFrontend(new Date(booking.endDate))}
|
|
||||||
</div>
|
</div>
|
||||||
{storingBookingError && (
|
{storingBookingError && (
|
||||||
<div className="error-message flex-grow">{storingBookingError}</div>
|
<div className="error-message flex-grow">{storingBookingError}</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user