Skip to content

Commit ca707d9

Browse files
🐛 - fix: fix a bug where the date format in various grid was not correct.
1 parent b4d951d commit ca707d9

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

frontend/src/pages/destructionlist/hooks/useFields.ts

+9-7
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import {
1010
getFieldSelection,
1111
removeFromFieldSelection,
1212
} from "../../../lib/fieldSelection/fieldSelection";
13+
import { formatDate } from "../../../lib/format/date";
1314
import { ExpandZaak, Zaak } from "../../../types";
1415
import { FIELD_SELECTION_STORAGE_KEY } from "../../constants";
1516
import { useSelectielijstKlasseChoices } from "./useSelectielijstKlasseChoices";
@@ -71,11 +72,15 @@ export function useFields(
7172
{
7273
name: "startdatum",
7374
type: "daterange",
75+
valueTransform: (rowData) =>
76+
rowData.startdatum ? formatDate(rowData.startdatum as string) : "",
7477
width: "150px",
7578
},
7679
{
7780
name: "einddatum",
7881
type: "daterange",
82+
valueTransform: (rowData) =>
83+
rowData.einddatum ? formatDate(rowData.einddatum as string) : "",
7984
width: "150px",
8085
},
8186
{
@@ -130,13 +135,10 @@ export function useFields(
130135
name: "archiefactiedatum",
131136
type: "daterange",
132137
width: "130px",
133-
valueTransform: (rowData) => {
134-
if (!rowData.archiefactiedatum) {
135-
return null;
136-
}
137-
// FIXME?
138-
return;
139-
},
138+
valueTransform: (rowData) =>
139+
rowData.archiefactiedatum
140+
? formatDate(rowData.archiefactiedatum as string)
141+
: "",
140142
},
141143
{
142144
active: false,

0 commit comments

Comments
 (0)