PluginProbe
Yatra – Travel Booking & Tour Operator Software / 3.0.17
Yatra – Travel Booking & Tour Operator Software v3.0.17
3.0.17 3.0.16 3.0.15 3.0.14 3.0.14.1 3.0.14.2 3.0.12 3.0.13 3.0.11 3.0.10 3.0.9 3.0.8 3.0.7 3.0.6 3.0.5 3.0.5.1 3.0.4 3.0.3 3.0.2.9 3.0.2.7 3.0.2.8 3.0.2.6 trunk 1.0.0 2.0.0 All 85 releases
← All changes | resources/js/components/dashboard/RecentBookings.tsx +6 -2 3.0.3 → 3.0.17 View file →
@@ -4,8 +4,9 @@
4 4 */
5 5
6 6 import React from "react";
7 7 import { __ } from "../../lib/i18n";
8 +import { toDateValue } from "../../lib/dateFormat";
8 9 import { Card, CardContent, CardHeader, CardTitle } from "../ui/card";
9 10 import { Badge } from "../ui/badge";
10 11 import { Calendar, User, ArrowRight } from "lucide-react";
11 12 import { formatYatraMoney } from "../../lib/currency-display";
@@ -33,10 +34,13 @@
33 34 bookings,
34 35 loading = false,
35 36 onView,
36 37 }) => {
37 - const formatDate = (dateString: string) => {
38 - return new Date(dateString).toLocaleDateString("en-US", {
38 + const formatDate = (dateString?: string | null) => {
39 + // toDateValue: a date-only booking_date must not roll back a day in behind-UTC zones.
40 + const date = toDateValue(dateString);
41 + if (isNaN(date.getTime())) return "-";
42 + return date.toLocaleDateString("en-US", {
39 43 month: "short",
40 44 day: "numeric",
41 45 year: "numeric",
42 46 });