Skip to content

Commit

Permalink
fix: fail to fill cell to datetime column(Postgre) fixes #924
Browse files Browse the repository at this point in the history
  • Loading branch information
dyaskur committed Jan 22, 2025
1 parent 450c4c4 commit d3d7ab3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/renderer/components/WorkspaceTabQueryTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -696,14 +696,14 @@ const fillCell = (event: { name: string; group: string; type: string }) => {
}
fakeValue = (fakerCustom as any)[event.group][event.name]();
const isDateType = [...DATE, ...DATETIME].includes(selectedCell.value.type);
if (['string', 'number'].includes(typeof fakeValue)) {
if (typeof fakeValue === 'number')
fakeValue = String(fakeValue);
if (selectedCell.value.length)
if (selectedCell.value.length && !isDateType)
fakeValue = fakeValue.substring(0, selectedCell.value.length < 1024 ? Number(selectedCell.value.length) : 1024);
}
else if ([...DATE, ...DATETIME].includes(selectedCell.value.type))
else if (isDateType)
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}`);
Expand Down

0 comments on commit d3d7ab3

Please sign in to comment.