diff --git a/packages/lib/time.ts b/packages/lib/time.ts index c270b85829..2fc54b4260 100644 --- a/packages/lib/time.ts +++ b/packages/lib/time.ts @@ -97,7 +97,7 @@ export const getTodaysDateFormatted = (seperator: string) => { export function convertDatesInObject(obj: any) { for (let key in obj) { - if (typeof obj[key] === "string" && !isNaN(Date.parse(obj[key]))) { + if ((key === "createdAt" || key === "updatedAt") && !isNaN(Date.parse(obj[key]))) { obj[key] = new Date(obj[key]); } else if (typeof obj[key] === "object" && obj[key] !== null) { convertDatesInObject(obj[key]);