diff --git a/allianceauth/groupmanagement/templates/groupmanagement/audit.html b/allianceauth/groupmanagement/templates/groupmanagement/audit.html index 79fda99d..39812715 100644 --- a/allianceauth/groupmanagement/templates/groupmanagement/audit.html +++ b/allianceauth/groupmanagement/templates/groupmanagement/audit.html @@ -33,7 +33,7 @@ {% for entry in entries %} - {{ entry.date|date:"Y-m-d H:i" }} + {{ entry.date|date:"Y-M-d, H:i" }} {{ entry.requestor }} {{ entry.req_char }} {{ entry.req_char.corporation_name }} @@ -66,6 +66,7 @@ {% block extra_javascript %} {% include 'bundles/datatables-js.html' %} + {% include 'bundles/moment-js.html' %} {% endblock %} @@ -74,7 +75,26 @@ {% endblock %} {% block extra_script %} + + $.fn.dataTable.moment = function ( format, locale ) { + var types = $.fn.dataTable.ext.type; + + // Add type detection + types.detect.unshift( function ( d ) { + return moment( d, format, locale, true ).isValid() ? + 'moment-'+format : + null; + } ); + + // Add sorting method - use an integer for the sorting + types.order[ 'moment-'+format+'-pre' ] = function ( d ) { + return moment( d, format, locale, true ).unix(); + }; + }; + $(document).ready(function(){ + $.fn.dataTable.moment( 'YYYY-MMM-D, HH:mm' ); + $('#log-entries').DataTable({ order: [[ 0, 'desc' ], [ 1, 'asc' ] ], filterDropDown: