mirror of
https://github.com/django-helpdesk/django-helpdesk.git
synced 2025-06-04 17:05:36 +02:00
Use locale for last_followup
This commit is contained in:
parent
01c28a4d62
commit
9c8ca60f3c
@ -419,10 +419,15 @@
|
|||||||
{
|
{
|
||||||
data: "last_followup",
|
data: "last_followup",
|
||||||
render: function (data, type, row) {
|
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);
|
let date = new Date(data);
|
||||||
return date.toLocaleString("en-US", {
|
return date.toLocaleString(locale, {
|
||||||
weekday: "short",
|
weekday: "short",
|
||||||
year: "numeric",
|
year: "numeric",
|
||||||
month: "long",
|
month: "long",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user