From bca95bcb662afb1c5267e8215575164f3a2dfeac Mon Sep 17 00:00:00 2001 From: ma0068 Date: Mon, 10 Feb 2025 11:04:02 +0100 Subject: [PATCH] change dateFormat Tab Notizen --- application/models/person/Notiz_model.php | 4 ++-- public/js/components/Notiz/Notiz.js | 22 +++++++++++++++++++++- 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/application/models/person/Notiz_model.php b/application/models/person/Notiz_model.php index 2d1e054c3..2e99d1cdd 100644 --- a/application/models/person/Notiz_model.php +++ b/application/models/person/Notiz_model.php @@ -156,10 +156,10 @@ class Notiz_model extends DB_Model $qry = " SELECT n.*, count(dms_id) as countDoc, z.notizzuordnung_id, - TO_CHAR (CASE + (CASE WHEN n.updateamum >= n.insertamum THEN n.updateamum ELSE n.insertamum - END::timestamp, 'DD.MM.YYYY HH24:MI:SS') AS lastUpdate, + END) AS lastUpdate, regexp_replace(n.text, '<[^>]*>', '', 'g') as text_stripped, TO_CHAR(n.start::timestamp, 'DD.MM.YYYY') AS start_format, TO_CHAR(n.ende::timestamp, 'DD.MM.YYYY') AS ende_format, diff --git a/public/js/components/Notiz/Notiz.js b/public/js/components/Notiz/Notiz.js index 97e676339..f5b721300 100644 --- a/public/js/components/Notiz/Notiz.js +++ b/public/js/components/Notiz/Notiz.js @@ -116,7 +116,27 @@ export default { {title: "Notizzuordnung_id", field: "notizzuordnung_id", width: 164, visible: false}, {title: "type_id", field: "type_id", width: 164, visible: false}, {title: "extension_id", field: "id", width: 135, visible: false}, - {title: "letzte Änderung", field: "lastupdate", width: 146, visible: false}, + { + title: "letzte Änderung", + field: "lastupdate", + width: 146, + visible: false, + formatter: function (cell) { + const dateStr = cell.getValue(); + if (!dateStr) return ""; + + const date = new Date(dateStr); + return date.toLocaleString("de-DE", { + day: "2-digit", + month: "2-digit", + year: "numeric", + hour: "2-digit", + minute: "2-digit", + second: "2-digit", + hour12: false + }); + } + }, { title: 'Aktionen', field: 'actions', width: 100,