{{::log.creationDate | dateTime:'dd/MM/yyyy HH:mm'}}
@@ -23,7 +32,7 @@
Changed by:
{{::log.user.name | dashIfEmpty}}
@@ -45,7 +54,7 @@
{{::log.user.name | dashIfEmpty}}
@@ -89,7 +98,7 @@
-
+
{
+ log.oldProperties = this.getInstance(log.oldInstance);
+ log.newProperties = this.getInstance(log.newInstance);
+ });
+ }
}
showWorkerDescriptor(event, workerFk) {
@@ -22,6 +51,22 @@ export default class Controller {
this.$.workerDescriptor.parent = event.target;
this.$.workerDescriptor.show();
}
+
+ 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;
+ }
+ return null;
+ }
}
Controller.$inject = ['$scope'];
@@ -30,6 +75,8 @@ ngModule.component('vnLog', {
controller: Controller,
template: require('./index.html'),
bindings: {
- model: '<'
+ model: '<',
+ originId: '<',
+ url: '@'
}
});