1
1
mirror of https://github.com/Fabio286/antares.git synced 2025-02-16 19:50:37 +01:00

feat(PostgreSQL): edit timezone in cell editor

This commit is contained in:
Fabio Di Stasio 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,
triggerAdd: false,
routineAdd: true,
functionAdd: true,
functionAdd: false,
databaseEdit: false,
tableSettings: true,
viewSettings: true,

View File

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

View File

@ -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';
@ -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 };
}
@ -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 };
}