# HG changeset patch # User Raimund Renkert # Date 1488985248 -3600 # Node ID 7cf7a8dc7818c7b44ebfb92973ae274d091af4be # Parent e53e398df409aa6cb1422cd073e26e575728551f Parse timestamp using a mapping table to identify date fields. diff -r e53e398df409 -r 7cf7a8dc7818 app/view/window/AuditTrail.js --- a/app/view/window/AuditTrail.js Wed Mar 08 09:45:01 2017 +0100 +++ b/app/view/window/AuditTrail.js Wed Mar 08 16:00:48 2017 +0100 @@ -21,6 +21,15 @@ objectId: null, + dateItems: [ + "probeentnahme_beginn", + "probeentnahme_ende", + "solldatum_beginn", + "solldatum_ende", + "messzeitpunkt", + "datum" + ], + /** * This function initialises the Window @@ -108,9 +117,15 @@ html += '
geändert in
' } for (var key in audit[i].changedFields) { - var val = audit[i].changedFields[key] === 'null' ? '' : - audit[i].changedFields[key]; - html += '' + i18n.getMsg(key) + ': ' + val + '
'; + var value = ''; + if (Ext.Array.contains(this.dateItems, key)) { + value = Ext.Date.format(new Date(audit[i].changedFields[key]), 'd.m.Y H:i'); + } + else { + value = audit[i].changedFields[key]; + } + html += '' + i18n.getMsg(key) + ': ' + + value + '
'; } html += '
'; html += '

'; @@ -141,8 +156,15 @@ html += '
geändert in
' } for (var key in audit[i].changedFields) { + var value = ''; + if (Ext.Array.contains(this.dateItems, key)) { + value = Ext.Date.format(new Date(audit[i].changedFields[key]), 'd.m.Y H:i'); + } + else { + value = audit[i].changedFields[key]; + } html += '' + i18n.getMsg(key) + ': ' + - audit[i].changedFields[key] + '
'; + value + '
'; } html += '
'; html += '

';