mirror of
https://github.com/inventree/InvenTree.git
synced 2026-10-08 03:11:22 +00:00
[UI] Fixes for part stock history (#10293)
- Correct default data ordering - Fix rendering for date labels
This commit is contained in:
1 parent
818976320c
commit
b65a3f985d
1 file changed
+3
-3
@@ -32,7 +32,7 @@ import { InvenTreeTable } from '../../tables/InvenTreeTable';
|
|||||||
function ChartTooltip({ label, payload }: Readonly<ChartTooltipProps>) {
|
function ChartTooltip({ label, payload }: Readonly<ChartTooltipProps>) {
|
||||||
const formattedLabel: string = useMemo(() => {
|
const formattedLabel: string = useMemo(() => {
|
||||||
if (label && typeof label === 'number') {
|
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) {
|
} else if (!!label) {
|
||||||
return label.toString();
|
return label.toString();
|
||||||
} else {
|
} else {
|
||||||
@@ -190,7 +190,7 @@ export default function PartStockHistoryDetail({
|
|||||||
enableBulkDelete: true,
|
enableBulkDelete: true,
|
||||||
params: {
|
params: {
|
||||||
part: partId,
|
part: partId,
|
||||||
ordering: 'date'
|
ordering: '-date'
|
||||||
},
|
},
|
||||||
rowActions: rowActions
|
rowActions: rowActions
|
||||||
}}
|
}}
|
||||||
@@ -225,7 +225,7 @@ export default function PartStockHistoryDetail({
|
|||||||
type: 'number',
|
type: 'number',
|
||||||
domain: chartLimits,
|
domain: chartLimits,
|
||||||
tickFormatter: (value: number) => {
|
tickFormatter: (value: number) => {
|
||||||
return formatDate(dayjs().format('YYYY-MM-DD'));
|
return formatDate(dayjs(value).format('YYYY-MM-DD'));
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
series={[
|
series={[
|
||||||
|
|||||||
Reference in new issue
Block a user