| @@ -18,8 +18,9 @@ | ||
| 18 | 18 | Send, |
| 19 | 19 | Loader2, |
| 20 | 20 | } from "lucide-react"; |
| 21 | 21 | import { __ } from "../lib/i18n"; |
| 22 | +import { toDateValue } from "../lib/dateFormat"; | |
| 22 | 23 | import { apiService } from "../lib/api-client"; |
| 23 | 24 | import { usePermissions } from "../hooks/usePermissions"; |
| 24 | 25 | import { Button } from "../components/ui/button"; |
| 25 | 26 | import { PageHeader } from "../components/common/PageHeader"; |
| @@ -104,9 +105,11 @@ | ||
| 104 | 105 | }, |
| 105 | 106 | }); |
| 106 | 107 | |
| 107 | 108 | const formatDate = (dateString: string) => { |
| 108 | - return new Date(dateString).toLocaleDateString("en-US", { | |
| 109 | + // toDateValue: a date-only travel_date must not roll back a day in a | |
| 110 | + // behind-UTC zone (datetime values like created_at pass through unchanged). | |
| 111 | + return toDateValue(dateString).toLocaleDateString("en-US", { | |
| 109 | 112 | weekday: "long", |
| 110 | 113 | year: "numeric", |
| 111 | 114 | month: "long", |
| 112 | 115 | day: "numeric", |
| @@ -129,8 +132,13 @@ | ||
| 129 | 132 | className: |
| 130 | 133 | "bg-yellow-100 text-yellow-700 dark:bg-yellow-900/20 dark:text-yellow-400", |
| 131 | 134 | label: __("Responded", "yatra"), |
| 132 | 135 | }, |
| 136 | + completed: { | |
| 137 | + className: | |
| 138 | + "bg-teal-100 text-teal-700 dark:bg-teal-900/20 dark:text-teal-400", | |
| 139 | + label: __("Completed", "yatra"), | |
| 140 | + }, | |
| 133 | 141 | converted: { |
| 134 | 142 | className: |
| 135 | 143 | "bg-green-100 text-green-700 dark:bg-green-900/20 dark:text-green-400", |
| 136 | 144 | label: __("Converted", "yatra"), |
| @@ -301,8 +309,9 @@ | ||
| 301 | 309 | </Button> |
| 302 | 310 | <ConditionalRender capability="yatra_respond_to_enquiries"> |
| 303 | 311 | <div className="flex items-center gap-2"> |
| 304 | 312 | {enquiry.status !== "responded" && |
| 313 | + enquiry.status !== "completed" && | |
| 305 | 314 | enquiry.status !== "closed" && ( |
| 306 | 315 | <Button |
| 307 | 316 | variant="outline" |
| 308 | 317 | onClick={handleRespond} |