1
1
mirror of https://github.com/Fabio286/antares.git synced 2025-06-05 21:59:22 +02:00

feat(PostgreSQL): edit timezone in cell editor

This commit is contained in:
2021-04-11 10:55:22 +02:00
parent 3dde1c109e
commit 8735a0c5f9
3 changed files with 15 additions and 2 deletions

View File

@ -22,7 +22,7 @@ module.exports = {
viewAdd: true, viewAdd: true,
triggerAdd: false, triggerAdd: false,
routineAdd: true, routineAdd: true,
functionAdd: true, functionAdd: false,
databaseEdit: false, databaseEdit: false,
tableSettings: true, tableSettings: true,
viewSettings: true, viewSettings: true,

View File

@ -54,6 +54,7 @@ export const TIME = [
'TIME', 'TIME',
'TIME WITH TIME ZONE' 'TIME WITH TIME ZONE'
]; ];
export const DATETIME = [ export const DATETIME = [
'DATETIME', 'DATETIME',
'TIMESTAMP', 'TIMESTAMP',
@ -61,6 +62,12 @@ export const DATETIME = [
'TIMESTAMP WITH 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 = [ export const BLOB = [
'BLOB', 'BLOB',
'TINYBLOB', 'TINYBLOB',

View File

@ -182,7 +182,7 @@ import { mimeFromHex } from 'common/libs/mimeFromHex';
import { formatBytes } from 'common/libs/formatBytes'; import { formatBytes } from 'common/libs/formatBytes';
import { bufferToBase64 } from 'common/libs/bufferToBase64'; import { bufferToBase64 } from 'common/libs/bufferToBase64';
import hexToBinary from 'common/libs/hexToBinary'; 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 { VueMaskDirective } from 'v-mask';
import ConfirmModal from '@/components/BaseConfirmModal'; import ConfirmModal from '@/components/BaseConfirmModal';
import TextEditor from '@/components/BaseTextEditor'; import TextEditor from '@/components/BaseTextEditor';
@ -286,6 +286,9 @@ export default {
for (let i = 0; i < precision; i++) for (let i = 0; i < precision; i++)
timeMask += i === 0 ? '.#' : '#'; timeMask += i === 0 ? '.#' : '#';
if (HAS_TIMEZONE.includes(this.editingType))
timeMask += 'X##';
return { type: 'text', mask: timeMask }; return { type: 'text', mask: timeMask };
} }
@ -299,6 +302,9 @@ export default {
for (let i = 0; i < precision; i++) for (let i = 0; i < precision; i++)
datetimeMask += i === 0 ? '.#' : '#'; datetimeMask += i === 0 ? '.#' : '#';
if (HAS_TIMEZONE.includes(this.editingType))
datetimeMask += 'X##';
return { type: 'text', mask: datetimeMask }; return { type: 'text', mask: datetimeMask };
} }