This commit is contained in:
shafi54 2026-01-25 02:28:33 +05:30
parent 3ec9cf8795
commit 489d0905c5
3 changed files with 8 additions and 5 deletions

View file

@ -19,6 +19,7 @@
"axios": "^1.7.9", "axios": "^1.7.9",
"class-variance-authority": "^0.7.0", "class-variance-authority": "^0.7.0",
"clsx": "^2.1.1", "clsx": "^2.1.1",
"dayjs": "^1.11.19",
"formik": "^2.4.9", "formik": "^2.4.9",
"jwt-decode": "^4.0.0", "jwt-decode": "^4.0.0",
"react": "19.0.0", "react": "19.0.0",

View file

@ -3,6 +3,7 @@ import { useSearch } from '@tanstack/react-router'
import { trpc } from '../trpc/client' import { trpc } from '../trpc/client'
import { cn } from '@/lib/utils' import { cn } from '@/lib/utils'
import { Button } from '@/components/ui/button' import { Button } from '@/components/ui/button'
import dayjs from 'dayjs'
interface VendorOrder { interface VendorOrder {
orderId: string orderId: string
@ -145,7 +146,7 @@ const { data: regularOrders } = trpc.admin.vendorSnippets.getOrdersBySnippet.use
> >
{upcomingSlots.data.map((slot) => ( {upcomingSlots.data.map((slot) => (
<option key={slot.id} value={slot.id}> <option key={slot.id} value={slot.id}>
{new Date(slot.deliveryTime).toLocaleDateString()} {new Date(slot.deliveryTime).toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' })} {dayjs(slot.deliveryTime).format('ddd, MMM DD hh:mm A')}
</option> </option>
))} ))}
</select> </select>
@ -181,9 +182,9 @@ const { data: regularOrders } = trpc.admin.vendorSnippets.getOrdersBySnippet.use
</div> </div>
) : ( ) : (
<div className="grid gap-4 sm:grid-cols-2 lg:grid-cols-3"> <div className="grid gap-4 sm:grid-cols-2 lg:grid-cols-3">
{orders.map((order) => { {orders.map((order) => {
const parsedDate = order.orderDate const parsedDate = order.orderDate
? new Date(order.orderDate).toLocaleString() ? dayjs(order.orderDate).format('ddd, MMM DD hh:mm A')
: 'N/A' : 'N/A'
const badgeClass = 'border-slate-200 bg-slate-100 text-slate-600 inline-flex items-center rounded-full border px-3 py-0.5 text-xs font-semibold uppercase' const badgeClass = 'border-slate-200 bg-slate-100 text-slate-600 inline-flex items-center rounded-full border px-3 py-0.5 text-xs font-semibold uppercase'

1
package-lock.json generated
View file

@ -214,6 +214,7 @@
"axios": "^1.7.9", "axios": "^1.7.9",
"class-variance-authority": "^0.7.0", "class-variance-authority": "^0.7.0",
"clsx": "^2.1.1", "clsx": "^2.1.1",
"dayjs": "^1.11.19",
"formik": "^2.4.9", "formik": "^2.4.9",
"jwt-decode": "^4.0.0", "jwt-decode": "^4.0.0",
"react": "19.0.0", "react": "19.0.0",