mirror of https://github.com/Fabio286/antares.git
fix: time and datetime precision
This commit is contained in:
parent
13b0816837
commit
771f8a2d68
|
@ -196,29 +196,39 @@ export default {
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
inputProps () {
|
inputProps () {
|
||||||
if ([...TEXT, ...LONG_TEXT].includes(this.type))
|
if ([...TEXT, ...LONG_TEXT].includes(this.editingType))
|
||||||
return { type: 'text', mask: false };
|
return { type: 'text', mask: false };
|
||||||
|
|
||||||
if (NUMBER.includes(this.type))
|
if (NUMBER.includes(this.editingType))
|
||||||
return { type: 'number', mask: false };
|
return { type: 'number', mask: false };
|
||||||
|
|
||||||
if (TIME.includes(this.type))
|
if (TIME.includes(this.editingType)) {
|
||||||
return { type: 'number', mask: false };
|
let timeMask = '##:##:##';
|
||||||
|
const precision = this.fieldPrecision(this.editingField);
|
||||||
|
|
||||||
if (DATE.includes(this.type))
|
for (let i = 0; i < precision; i++)
|
||||||
|
timeMask += i === 0 ? '.#' : '#';
|
||||||
|
|
||||||
|
return { type: 'text', mask: timeMask };
|
||||||
|
}
|
||||||
|
|
||||||
|
if (DATE.includes(this.editingType))
|
||||||
return { type: 'text', mask: '####-##-##' };
|
return { type: 'text', mask: '####-##-##' };
|
||||||
|
|
||||||
if (DATETIME.includes(this.type)) {
|
if (DATETIME.includes(this.editingType)) {
|
||||||
let datetimeMask = '####-##-## ##:##:##';
|
let datetimeMask = '####-##-## ##:##:##';
|
||||||
for (let i = 0; i < this.precision; i++)
|
const precision = this.fieldPrecision(this.editingField);
|
||||||
|
|
||||||
|
for (let i = 0; i < precision; i++)
|
||||||
datetimeMask += i === 0 ? '.#' : '#';
|
datetimeMask += i === 0 ? '.#' : '#';
|
||||||
|
|
||||||
return { type: 'text', mask: datetimeMask };
|
return { type: 'text', mask: datetimeMask };
|
||||||
}
|
}
|
||||||
|
|
||||||
if (BLOB.includes(this.type))
|
if (BLOB.includes(this.editingType))
|
||||||
return { type: 'file', mask: false };
|
return { type: 'file', mask: false };
|
||||||
|
|
||||||
if (BIT.includes(this.type))
|
if (BIT.includes(this.editingType))
|
||||||
return { type: 'text', mask: false };
|
return { type: 'text', mask: false };
|
||||||
|
|
||||||
return { type: 'text', mask: false };
|
return { type: 'text', mask: false };
|
||||||
|
|
Loading…
Reference in New Issue