From 9c8ca60f3cf94e87d3c5b745a3bc734f1d91bce4 Mon Sep 17 00:00:00 2001 From: DavidVadnais Date: Wed, 19 Mar 2025 23:29:43 +0000 Subject: [PATCH] Use locale for last_followup --- helpdesk/templates/helpdesk/ticket_list.html | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/helpdesk/templates/helpdesk/ticket_list.html b/helpdesk/templates/helpdesk/ticket_list.html index 2033487f..e4b9c631 100644 --- a/helpdesk/templates/helpdesk/ticket_list.html +++ b/helpdesk/templates/helpdesk/ticket_list.html @@ -419,10 +419,15 @@ { data: "last_followup", render: function (data, type, row) { - if (isNaN(Date.parse(data))) return "No followup found"; + let locale = window.django_settings ? window.django_settings.LANGUAGE_CODE : 'en-US'; // Default to en-US if settings are not found + + if (isNaN(Date.parse(data))) { + let noFollowup = window.django_settings && window.django_settings.TRANSLATIONS && window.django_settings.TRANSLATIONS['No followup found'] ? window.django_settings.TRANSLATIONS['No followup found'] : "No followup found"; + return noFollowup; + } let date = new Date(data); - return date.toLocaleString("en-US", { + return date.toLocaleString(locale, { weekday: "short", year: "numeric", month: "long",