style: format code
parent
5a4d5ff6a7
commit
6420443466
|
@ -1,15 +1,11 @@
|
|||
export function formatDate(value, format) {
|
||||
const isFunction = function(obj) {
|
||||
return !!(obj && obj.constructor && obj.call && obj.apply);
|
||||
};
|
||||
|
||||
if (!value) {
|
||||
return '';
|
||||
}
|
||||
if (Array.isArray(format)) {
|
||||
format = format[0];
|
||||
}
|
||||
if (isFunction(format)) {
|
||||
if (typeof format === 'function') {
|
||||
const result = format(value);
|
||||
if (typeof result === 'string') {
|
||||
return result;
|
||||
|
|
|
@ -157,7 +157,7 @@ export default {
|
|||
sPagination: this.getDefaultPagination(this.$props),
|
||||
pivot: undefined,
|
||||
sComponents: createComponents(this.components),
|
||||
filterDataCnt: 0
|
||||
filterDataCnt: 0,
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
|
|
|
@ -92,10 +92,6 @@ export function isAllowedDate(value, disabledDate, disabledTime) {
|
|||
}
|
||||
|
||||
export function formatDate(value, format) {
|
||||
const isFunction = function(obj) {
|
||||
return !!(obj && obj.constructor && obj.call && obj.apply);
|
||||
};
|
||||
|
||||
if (!value) {
|
||||
return '';
|
||||
}
|
||||
|
@ -104,7 +100,7 @@ export function formatDate(value, format) {
|
|||
format = format[0];
|
||||
}
|
||||
|
||||
if (isFunction(format)) {
|
||||
if (typeof format === 'function') {
|
||||
const result = format(value);
|
||||
if (typeof result === 'string') {
|
||||
return result;
|
||||
|
|
Loading…
Reference in New Issue