updates on the login page and order page and fixed on the logo and the date validation

This commit is contained in:
2026-07-02 11:11:48 +05:30
parent 39e97c3041
commit b4cf2be556
2 changed files with 38 additions and 43 deletions

View File

@@ -206,6 +206,16 @@ const ORDERS_STATUS_TABS = [
{ idx: 3, status: 'cancelled', label: 'Cancelled', color: '#ef4444', icon: MdCancel, countKey: 'cancelled' }
];
const formatOrderDate = (row) => {
const dateCandidates = [row.pickupslot, row.deliverydate, row.orderdate];
for (const candidate of dateCandidates) {
if (candidate && dayjs(candidate).isValid()) {
return `${dayjs(candidate).utc().format('DD/MM/YYYY')} ${dayjs(candidate).format('hh:mm A')}`;
}
}
return '—';
};
const Orders = () => {
const theme = useTheme();
const isMobile = useMediaQuery(theme.breakpoints.down('md'));
@@ -1469,7 +1479,7 @@ const Orders = () => {
{`${row.locationname}-(${row.locationsuburb})`}
</Typography>
<Typography variant="caption" sx={{ color: DT.textSecondary }}>
{row.orderid} · {dayjs(row.pickupslot).utc().format('DD/MM/YYYY')} {dayjs(row.pickupslot).format('hh:mm A')}
{row.orderid} · {formatOrderDate(row)}
</Typography>
</MobileField>
<MobileField label="Pickup">
@@ -1691,7 +1701,7 @@ const Orders = () => {
</Tooltip>
<Tooltip title="Pickup Slot">
<Typography noWrap sx={{ fontSize: '12px' }}>
{dayjs(row.pickupslot).utc().format('DD/MM/YYYY')} {dayjs(row.pickupslot).format('hh:mm A')}
{formatOrderDate(row)}
</Typography>
</Tooltip>
</TableCell>