From a939d2ff3d52ff43d0f1f301e68f23acdc6c7a34 Mon Sep 17 00:00:00 2001 From: DavidVadnais Date: Tue, 18 Mar 2025 22:42:26 +0000 Subject: [PATCH] humanize last_followup date --- helpdesk/templates/helpdesk/ticket_list.html | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/helpdesk/templates/helpdesk/ticket_list.html b/helpdesk/templates/helpdesk/ticket_list.html index 91e69c12..2033487f 100644 --- a/helpdesk/templates/helpdesk/ticket_list.html +++ b/helpdesk/templates/helpdesk/ticket_list.html @@ -416,7 +416,23 @@ } }, {data: "submitter"}, - {data: "last_followup"}, + { + data: "last_followup", + render: function (data, type, row) { + if (isNaN(Date.parse(data))) return "No followup found"; + + let date = new Date(data); + return date.toLocaleString("en-US", { + weekday: "short", + year: "numeric", + month: "long", + day: "numeric", + hour: "2-digit", + minute: "2-digit", + hour12: true + }); + } + }, {% if helpdesk_settings.HELPDESK_ENABLE_TIME_SPENT_ON_TICKET %} {data: "time_spent", "visible": false}, {% endif %}