diff --git a/studio/components/interfaces/TableGridEditor/SidePanelEditor/RowEditor/RowEditor.utils.ts b/studio/components/interfaces/TableGridEditor/SidePanelEditor/RowEditor/RowEditor.utils.ts index 0a866d85283..2d65caf9c96 100644 --- a/studio/components/interfaces/TableGridEditor/SidePanelEditor/RowEditor/RowEditor.utils.ts +++ b/studio/components/interfaces/TableGridEditor/SidePanelEditor/RowEditor/RowEditor.utils.ts @@ -177,11 +177,13 @@ const nowDateTimeValue = (format: string) => { } const convertPostgresDatetimeToInputDatetime = (format: string, value: string) => { - const valueWithSlashes = value.replaceAll('-', '/') + if (value) { + value = value.includes('-') ? value.replaceAll('-', '/') : value + } if (!value || value.length == 0) return '' if (TIMESTAMP_TYPES.includes(format)) { - return dayjs(valueWithSlashes).format('YYYY-MM-DDTHH:mm:ss') + return dayjs(value).format('YYYY-MM-DDTHH:mm:ss') } else if (TIME_TYPES.includes(format)) { const serverTimeFormat = value && value.includes('+') ? 'HH:mm:ssZZ' : 'HH:mm:ss' return dayjs(value, serverTimeFormat).format('HH:mm:ss')