|
@@ -773,7 +780,7 @@ function BillsTable({
|
- {clockOf(bill.billedat)}
+ {clockOf(billedAt ?? bill.billedat)}
|
{showBranch ? (
@@ -824,10 +831,16 @@ function stamp(value: string | undefined): string {
return `${parsed.toLocaleDateString('en-IN', { day: '2-digit', month: 'short' })}, ${clockOf(value)}`;
}
-function clockOf(value: string | undefined): string {
- if (!value) return '—';
+/**
+ * Takes an epoch too, so a bill can pass the instant `billedAtMs` recovered
+ * rather than the stamp it arrived with. Formatting the raw `billedat` shifted
+ * an already-wrong time by another +05:30 and put a 17:17 sale on the row at
+ * 22:47 — two bugs compounding into a plausible-looking number.
+ */
+function clockOf(value: string | number | undefined): string {
+ if (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.toLocaleTimeString('en-IN', {
hour: '2-digit',
minute: '2-digit',
|