From 59f22a1627e8eed023ca258530a0768c7350fc2b Mon Sep 17 00:00:00 2001 From: Oliver Date: Wed, 26 Mar 2025 14:27:55 +1100 Subject: [PATCH] Dayjs updates (#9388) * Update Scan.tsx * Tweak Scan.tsx --- src/frontend/src/pages/Index/Scan.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/frontend/src/pages/Index/Scan.tsx b/src/frontend/src/pages/Index/Scan.tsx index 87aa7de548..d6f3a1e266 100644 --- a/src/frontend/src/pages/Index/Scan.tsx +++ b/src/frontend/src/pages/Index/Scan.tsx @@ -20,6 +20,7 @@ import { import { useCallback, useEffect, useMemo, useState } from 'react'; import { hideNotification, showNotification } from '@mantine/notifications'; +import dayjs from 'dayjs'; import { api } from '../../App'; import { BarcodeInput } from '../../components/barcodes/BarcodeInput'; import type { BarcodeScanItem } from '../../components/barcodes/BarcodeScanItem'; @@ -103,7 +104,7 @@ export default function Scan() { id: randomId(), barcode: barcode, data: data, - timestamp: new Date(), + timestamp: dayjs().toDate(), source: 'scan', model: model_type as ModelType, pk: data[model_type]?.pk @@ -117,7 +118,7 @@ export default function Scan() { id: randomId(), barcode: barcode, data: data, - timestamp: new Date(), + timestamp: dayjs().toDate(), source: 'scan' }); }