2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-11-13 19:36:46 +00:00

[UI] Fixes for part stock history (#10293) (#10294)

- Correct default data ordering
- Fix rendering for date labels

(cherry picked from commit b65a3f985d)

Co-authored-by: Oliver <oliver.henry.walters@gmail.com>
This commit is contained in:
github-actions[bot]
2025-09-09 08:06:35 +10:00
committed by GitHub
parent 8571a42981
commit 2c95c3db29

View File

@@ -32,7 +32,7 @@ import { InvenTreeTable } from '../../tables/InvenTreeTable';
function ChartTooltip({ label, payload }: Readonly<ChartTooltipProps>) {
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={[