← All changes
|
resources/js/components/dashboard/RecentBookings.tsx
+4
-2
3.0.9
→
3.0.17
View file →
| @@ -34,11 +34,13 @@ | ||
| 34 | 34 | bookings, |
| 35 | 35 | loading = false, |
| 36 | 36 | onView, |
| 37 | 37 | }) => { |
| 38 | - const formatDate = (dateString: string) => { | |
| 38 | + const formatDate = (dateString?: string | null) => { | |
| 39 | 39 | // toDateValue: a date-only booking_date must not roll back a day in behind-UTC zones. |
| 40 | - return toDateValue(dateString).toLocaleDateString("en-US", { | |
| 40 | + const date = toDateValue(dateString); | |
| 41 | + if (isNaN(date.getTime())) return "-"; | |
| 42 | + return date.toLocaleDateString("en-US", { | |
| 41 | 43 | month: "short", |
| 42 | 44 | day: "numeric", |
| 43 | 45 | year: "numeric", |
| 44 | 46 | }); |