mirror of
https://gitlab.com/allianceauth/allianceauth.git
synced 2025-07-09 12:30:15 +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 %}
|
{% include "bundles/moment-js.html" with locale=True %}
|
||||||
|
|
||||||
{% get_datatables_language_static LANGUAGE_CODE as DT_LANG_PATH %}
|
{% get_datatables_language_static LANGUAGE_CODE as DT_LANG_PATH %}
|
||||||
|
{% get_momentjs_language_code LANGUAGE_CODE as MOMENTJS_LCODE %}
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
$(document).ready(function () {
|
$(document).ready(function () {
|
||||||
const MUMBLESTATS_DATETIME_FORMAT = 'YYYY-MM-DD, HH:mm';
|
const MUMBLESTATS_DATETIME_FORMAT = 'LLL';
|
||||||
|
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
@ -105,14 +106,28 @@
|
|||||||
{
|
{
|
||||||
data: 'last_connect',
|
data: 'last_connect',
|
||||||
render: (data) => {
|
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',
|
className: 'text-end',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
data: 'last_disconnect',
|
data: 'last_disconnect',
|
||||||
render: (data) => {
|
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',
|
className: 'text-end',
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user