timing
This commit is contained in:
@@ -27,6 +27,7 @@ import {
|
||||
orderValue,
|
||||
statusColor,
|
||||
billedAtMs,
|
||||
stampAfterMs,
|
||||
syncLagMs,
|
||||
type StatusKey,
|
||||
} from '../orderStatus';
|
||||
@@ -770,7 +771,11 @@ function DeliveriesTable({
|
||||
<Primary>
|
||||
<Mono>{row.orderid || `DLV-${row.deliveryid}`}</Mono>
|
||||
</Primary>
|
||||
<Secondary>{stamp(row.assigntime || row.deliverydate)}</Secondary>
|
||||
{/* Measured against the order own time: deliverydate
|
||||
arrives 5:30 early on every row - see stampAfterMs. */}
|
||||
<Secondary>
|
||||
{stamp(stampAfterMs(row.assigntime || row.deliverydate, row.deliverydate))}
|
||||
</Secondary>
|
||||
</Td>
|
||||
{showBranch ? (
|
||||
<Td isMuted>
|
||||
@@ -988,10 +993,10 @@ function BillsTable({
|
||||
/* ── Primitives ──────────────────────────────────────────────────────────── */
|
||||
|
||||
/** "21 Aug, 14:32". Falls back to the raw string rather than to "Invalid Date". */
|
||||
function stamp(value: string | undefined): string {
|
||||
if (!value) return '—';
|
||||
function stamp(value: string | number | null | undefined): string {
|
||||
if (value === null || value === undefined || value === '') return '—';
|
||||
const parsed = new Date(value);
|
||||
if (Number.isNaN(parsed.getTime())) return value;
|
||||
if (Number.isNaN(parsed.getTime())) return String(value);
|
||||
return `${parsed.toLocaleDateString('en-IN', { day: '2-digit', month: 'short' })}, ${clockOf(value)}`;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user