Fixed date parsing issue

This commit is contained in:
Colin Dawson 2026-01-31 22:15:07 +00:00
parent 01d6924dc4
commit 94675ed655

View File

@ -29,10 +29,11 @@ export function handleDates(body: any) {
for (const key of Object.keys(body)) {
const value = body[key];
if (value !== undefined && value !== "" && isNaN(value)) {
if (typeof value === "string" && value !== "" && isNaN(value as any)) {
const parsedValue: Date = parseISO(value);
if (isValid(parsedValue)) body[key] = parsedValue;
else if (typeof value === "object") handleDates(value);
} else if (typeof value === "object" && value !== null) {
handleDates(value);
}
}
}