From 2c95c3db297c2ddbcaee5a8dc8ec453c9f4b7303 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 9 Sep 2025 08:06:35 +1000 Subject: [PATCH] [UI] Fixes for part stock history (#10293) (#10294) - Correct default data ordering - Fix rendering for date labels (cherry picked from commit b65a3f985d673e9fadc9724224286702a15760be) Co-authored-by: Oliver --- src/frontend/src/pages/part/PartStockHistoryDetail.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/frontend/src/pages/part/PartStockHistoryDetail.tsx b/src/frontend/src/pages/part/PartStockHistoryDetail.tsx index 87d77b9e4e..01fded4056 100644 --- a/src/frontend/src/pages/part/PartStockHistoryDetail.tsx +++ b/src/frontend/src/pages/part/PartStockHistoryDetail.tsx @@ -32,7 +32,7 @@ import { InvenTreeTable } from '../../tables/InvenTreeTable'; function ChartTooltip({ label, payload }: Readonly) { const formattedLabel: string = useMemo(() => { if (label && typeof label === 'number') { - return formatDate(dayjs().format('YYYY-MM-DD')) ?? label; + return formatDate(dayjs(label).format('YYYY-MM-DD')) ?? label; } else if (!!label) { return label.toString(); } else { @@ -190,7 +190,7 @@ export default function PartStockHistoryDetail({ enableBulkDelete: true, params: { part: partId, - ordering: 'date' + ordering: '-date' }, rowActions: rowActions }} @@ -225,7 +225,7 @@ export default function PartStockHistoryDetail({ type: 'number', domain: chartLimits, tickFormatter: (value: number) => { - return formatDate(dayjs().format('YYYY-MM-DD')); + return formatDate(dayjs(value).format('YYYY-MM-DD')); } }} series={[