mirror of
https://github.com/tomru/pfadi-bussle.git
synced 2026-03-03 06:27:11 +01:00
fix createAt updatedAt types
This commit is contained in:
@@ -4,11 +4,7 @@ import Link from 'next/link'
|
|||||||
import { daysFormatFrontend } from '../helpers/date'
|
import { daysFormatFrontend } from '../helpers/date'
|
||||||
import { IBooking } from '../db/booking'
|
import { IBooking } from '../db/booking'
|
||||||
|
|
||||||
export default function BookingTable({
|
export default function BookingTable({ booking }: { booking: IBooking }) {
|
||||||
booking,
|
|
||||||
}: {
|
|
||||||
booking: IBooking
|
|
||||||
}) {
|
|
||||||
const data = [
|
const data = [
|
||||||
{ name: 'Status', value: booking.status },
|
{ name: 'Status', value: booking.status },
|
||||||
{ name: 'Buchungszeitraum', value: daysFormatFrontend(booking.days) },
|
{ name: 'Buchungszeitraum', value: daysFormatFrontend(booking.days) },
|
||||||
@@ -50,16 +46,11 @@ export default function BookingTable({
|
|||||||
</Link>
|
</Link>
|
||||||
</h3>
|
</h3>
|
||||||
<p className="mt-1 max-w-2xl text-sm text-gray-500">
|
<p className="mt-1 max-w-2xl text-sm text-gray-500">
|
||||||
Created{' '}
|
Created {booking.createdAt?.toLocaleString(new Intl.Locale('de'))}
|
||||||
{new Date(booking.createdAt).toLocaleString(
|
|
||||||
new Intl.Locale('de')
|
|
||||||
)}
|
|
||||||
</p>
|
</p>
|
||||||
<p className="mt-1 max-w-2xl text-sm text-gray-500">
|
<p className="mt-1 max-w-2xl text-sm text-gray-500">
|
||||||
Last updated{' '}
|
Last updated{' '}
|
||||||
{new Date(booking.updatedAt as string).toLocaleString(
|
{booking.updatedAt?.toLocaleString(new Intl.Locale('de'))}
|
||||||
new Intl.Locale('de')
|
|
||||||
)}
|
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<div className="border-t border-gray-200">
|
<div className="border-t border-gray-200">
|
||||||
@@ -67,8 +58,9 @@ export default function BookingTable({
|
|||||||
{data.map(({ name, value }, index) => (
|
{data.map(({ name, value }, index) => (
|
||||||
<div
|
<div
|
||||||
key={`${booking.uuid}-${name}`}
|
key={`${booking.uuid}-${name}`}
|
||||||
className={`${index % 2 === 1 ? 'bg-white' : 'bg-gray-100'
|
className={`${
|
||||||
} px-2 py-3 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-6`}
|
index % 2 === 1 ? 'bg-white' : 'bg-gray-100'
|
||||||
|
} px-2 py-3 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-6`}
|
||||||
>
|
>
|
||||||
<dt className="text-sm font-medium text-gray-500">{name}</dt>
|
<dt className="text-sm font-medium text-gray-500">{name}</dt>
|
||||||
<dd className="mt-1 text-sm text-gray-900 sm:mt-0 sm:col-span-2">
|
<dd className="mt-1 text-sm text-gray-900 sm:mt-0 sm:col-span-2">
|
||||||
@@ -80,4 +72,4 @@ export default function BookingTable({
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,6 +28,8 @@ export interface IBooking {
|
|||||||
destination?: string
|
destination?: string
|
||||||
days?: string[]
|
days?: string[]
|
||||||
calendarEventId?: string
|
calendarEventId?: string
|
||||||
|
createdAt?: NativeDate
|
||||||
|
updatedAt?: NativeDate
|
||||||
toJSON?: () => IBooking
|
toJSON?: () => IBooking
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user