From d3532608e13c2c61cd3b4bd9e8ee986fa5a1579f Mon Sep 17 00:00:00 2001 From: joan Date: Wed, 21 Oct 2020 14:05:14 +0200 Subject: [PATCH] Changed oldValue --- .../ticket/back/methods/ticket/componentUpdate.js | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/modules/ticket/back/methods/ticket/componentUpdate.js b/modules/ticket/back/methods/ticket/componentUpdate.js index 3edecbd614..6947cdc3b7 100644 --- a/modules/ticket/back/methods/ticket/componentUpdate.js +++ b/modules/ticket/back/methods/ticket/componentUpdate.js @@ -150,10 +150,20 @@ module.exports = Self => { minute: '2-digit', second: '2-digit' }).format(value); - oldValue = value; } - changesMade += `\r\n~${$t(change)}: ${value}~ ➔ *${$t(change)}: ${oldValue}*`; + if (oldValue instanceof Date) { + oldValue = new Intl.DateTimeFormat('es', { + year: '2-digit', + month: '2-digit', + day: '2-digit', + hour: '2-digit', + minute: '2-digit', + second: '2-digit' + }).format(oldValue); + } + + changesMade += `\r\n~${$t(change)}: ${oldValue}~ ➔ *${$t(change)}: ${value}*`; } const message = $t('Changed this data from the ticket', {