mirror of
https://github.com/formbricks/formbricks.git
synced 2026-04-13 12:02:01 -05:00
fix: Fix string gets converted to date causing validation error (#793)
This commit is contained in:
@@ -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]);
|
||||
|
||||
Reference in New Issue
Block a user