mirror of
https://gitlab.com/allianceauth/allianceauth.git
synced 2025-07-08 20:10:17 +02:00
Merge branch 'mumble-stats-date-fixes' into 'master'
[CHANGE] Datetime Improvements for Mumble Connection History See merge request allianceauth/allianceauth!1689
This commit is contained in:
commit
d51e730a7f
@ -84,10 +84,11 @@
|
||||
{% include "bundles/moment-js.html" with locale=True %}
|
||||
|
||||
{% get_datatables_language_static LANGUAGE_CODE as DT_LANG_PATH %}
|
||||
{% get_momentjs_language_code LANGUAGE_CODE as MOMENTJS_LCODE %}
|
||||
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
const MUMBLESTATS_DATETIME_FORMAT = 'YYYY-MM-DD, HH:mm';
|
||||
const MUMBLESTATS_DATETIME_FORMAT = 'LLL';
|
||||
|
||||
'use strict';
|
||||
|
||||
@ -105,14 +106,28 @@
|
||||
{
|
||||
data: 'last_connect',
|
||||
render: (data) => {
|
||||
return moment(data).utc().format(MUMBLESTATS_DATETIME_FORMAT);
|
||||
if (data === null) {
|
||||
return '';
|
||||
}
|
||||
|
||||
return moment(data)
|
||||
.locale('{{ MOMENTJS_LCODE }}')
|
||||
.utc()
|
||||
.format(MUMBLESTATS_DATETIME_FORMAT);
|
||||
},
|
||||
className: 'text-end',
|
||||
},
|
||||
{
|
||||
data: 'last_disconnect',
|
||||
render: (data) => {
|
||||
return moment(data).utc().format(MUMBLESTATS_DATETIME_FORMAT);
|
||||
if (data === null) {
|
||||
return '';
|
||||
}
|
||||
|
||||
return moment(data)
|
||||
.locale('{{ MOMENTJS_LCODE }}')
|
||||
.utc()
|
||||
.format(MUMBLESTATS_DATETIME_FORMAT);
|
||||
},
|
||||
className: 'text-end',
|
||||
},
|
||||
|
Loading…
x
Reference in New Issue
Block a user