Skip to content

Commit

Permalink
feat(PostgreSQL): edit timezone in cell editor
Browse files Browse the repository at this point in the history
  • Loading branch information
Fabio286 committed Apr 11, 2021
1 parent 3dde1c1 commit 8735a0c
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/common/customizations/postgresql.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ module.exports = {
viewAdd: true,
triggerAdd: false,
routineAdd: true,
functionAdd: true,
functionAdd: false,
databaseEdit: false,
tableSettings: true,
viewSettings: true,
Expand Down
7 changes: 7 additions & 0 deletions src/common/fieldTypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,20 @@ export const TIME = [
'TIME',
'TIME WITH TIME ZONE'
];

export const DATETIME = [
'DATETIME',
'TIMESTAMP',
'TIMESTAMP WITHOUT TIME ZONE',
'TIMESTAMP WITH TIME ZONE'
];

// Used to check datetime fields only
export const HAS_TIMEZONE = [
'TIMESTAMP WITH TIME ZONE',
'TIME WITH TIME ZONE'
];

export const BLOB = [
'BLOB',
'TINYBLOB',
Expand Down
8 changes: 7 additions & 1 deletion src/renderer/components/WorkspaceQueryTableRow.vue
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ import { mimeFromHex } from 'common/libs/mimeFromHex';
import { formatBytes } from 'common/libs/formatBytes';
import { bufferToBase64 } from 'common/libs/bufferToBase64';
import hexToBinary from 'common/libs/hexToBinary';
import { TEXT, LONG_TEXT, ARRAY, TEXT_SEARCH, NUMBER, FLOAT, BOOLEAN, DATE, TIME, DATETIME, BLOB, BIT } from 'common/fieldTypes';
import { TEXT, LONG_TEXT, ARRAY, TEXT_SEARCH, NUMBER, FLOAT, BOOLEAN, DATE, TIME, DATETIME, BLOB, BIT, HAS_TIMEZONE } from 'common/fieldTypes';
import { VueMaskDirective } from 'v-mask';
import ConfirmModal from '@/components/BaseConfirmModal';
import TextEditor from '@/components/BaseTextEditor';
Expand Down Expand Up @@ -286,6 +286,9 @@ export default {
for (let i = 0; i < precision; i++)
timeMask += i === 0 ? '.#' : '#';
if (HAS_TIMEZONE.includes(this.editingType))
timeMask += 'X##';
return { type: 'text', mask: timeMask };
}
Expand All @@ -299,6 +302,9 @@ export default {
for (let i = 0; i < precision; i++)
datetimeMask += i === 0 ? '.#' : '#';
if (HAS_TIMEZONE.includes(this.editingType))
datetimeMask += 'X##';
return { type: 'text', mask: datetimeMask };
}
Expand Down

0 comments on commit 8735a0c

Please sign in to comment.