diff --git a/modules/client/front/log/index.js b/modules/client/front/log/index.js index 9c591052ee..4552588e41 100644 --- a/modules/client/front/log/index.js +++ b/modules/client/front/log/index.js @@ -30,9 +30,13 @@ class Controller { } 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 = []; if (typeof instance == 'object' && instance != null) { 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]}); }); return properties; diff --git a/modules/ticket/front/log/index.js b/modules/ticket/front/log/index.js index 9b1ff55d38..fb11771625 100644 --- a/modules/ticket/front/log/index.js +++ b/modules/ticket/front/log/index.js @@ -31,8 +31,13 @@ class Controller { getInstance(instance) { 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) { 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]}); }); return properties;