#966 loggable
This commit is contained in:
parent
140e7b4f92
commit
ef7660162c
|
@ -30,9 +30,13 @@ class Controller {
|
||||||
}
|
}
|
||||||
|
|
||||||
getInstance(instance) {
|
getInstance(instance) {
|
||||||
|
let validDate = /^(-?(?:[1-9][0-9]*)?[0-9]{4})-(1[0-2]|0[1-9])-(3[01]|0[1-9]|[12][0-9])T(2[0-3]|[01][0-9]):([0-5][0-9]):([0-5][0-9])(.[0-9]+)?(Z)?$/;
|
||||||
const properties = [];
|
const properties = [];
|
||||||
if (typeof instance == 'object' && instance != null) {
|
if (typeof instance == 'object' && instance != null) {
|
||||||
Object.keys(instance).forEach(property => {
|
Object.keys(instance).forEach(property => {
|
||||||
|
if (validDate.test(instance[property]))
|
||||||
|
instance[property] = new Date(instance[property]).toLocaleString('es-ES');
|
||||||
|
|
||||||
properties.push({key: property, value: instance[property]});
|
properties.push({key: property, value: instance[property]});
|
||||||
});
|
});
|
||||||
return properties;
|
return properties;
|
||||||
|
|
|
@ -31,8 +31,13 @@ class Controller {
|
||||||
|
|
||||||
getInstance(instance) {
|
getInstance(instance) {
|
||||||
const properties = [];
|
const properties = [];
|
||||||
|
let validDate = /^(-?(?:[1-9][0-9]*)?[0-9]{4})-(1[0-2]|0[1-9])-(3[01]|0[1-9]|[12][0-9])T(2[0-3]|[01][0-9]):([0-5][0-9]):([0-5][0-9])(.[0-9]+)?(Z)?$/;
|
||||||
|
|
||||||
if (typeof instance == 'object' && instance != null) {
|
if (typeof instance == 'object' && instance != null) {
|
||||||
Object.keys(instance).forEach(property => {
|
Object.keys(instance).forEach(property => {
|
||||||
|
if (validDate.test(instance[property]))
|
||||||
|
instance[property] = new Date(instance[property]).toLocaleString('es-ES');
|
||||||
|
|
||||||
properties.push({key: property, value: instance[property]});
|
properties.push({key: property, value: instance[property]});
|
||||||
});
|
});
|
||||||
return properties;
|
return properties;
|
||||||
|
|
Loading…
Reference in New Issue