diff --git a/src/renderer/components/WorkspaceTabQueryTable.vue b/src/renderer/components/WorkspaceTabQueryTable.vue index b338403f..fc7f922c 100644 --- a/src/renderer/components/WorkspaceTabQueryTable.vue +++ b/src/renderer/components/WorkspaceTabQueryTable.vue @@ -696,15 +696,15 @@ const fillCell = (event: { name: string; group: string; type: string }) => { } fakeValue = (fakerCustom as any)[event.group][event.name](); - if (['string', 'number'].includes(typeof fakeValue)) { + const isDateType = [...DATE, ...DATETIME].includes(selectedCell.value.type); + if (isDateType) + fakeValue = moment(fakeValue).format(`YYYY-MM-DD HH:mm:ss${datePrecision}`); + else if (['string', 'number'].includes(typeof fakeValue)) { if (typeof fakeValue === 'number') fakeValue = String(fakeValue); - if (selectedCell.value.length) fakeValue = fakeValue.substring(0, selectedCell.value.length < 1024 ? Number(selectedCell.value.length) : 1024); } - else if ([...DATE, ...DATETIME].includes(selectedCell.value.type)) - fakeValue = moment(fakeValue).format(`YYYY-MM-DD HH:mm:ss${datePrecision}`); else if (TIME.includes(selectedCell.value.type)) fakeValue = moment(fakeValue).format(`HH:mm:ss${datePrecision}`);