Verified Commit ef42e22e authored by Sébastiaan Versteeg's avatar Sébastiaan Versteeg
Browse files

Fix sorting of registration dates in event admin

parent bc470873
......@@ -57,6 +57,17 @@ django.jQuery(function () {
type: "numeric"
});
$.tablesorter.addParser({
id: "date",
is: function(s) {
return false;
},
format: function(s, t, node) {
return $(node).attr("data-sortval");
},
type: "text"
});
$("table").tablesorter({
sortList: [[1,0]],
cssHeader: 'sortable',
......
......@@ -4,9 +4,9 @@
<thead>
<tr>
<th scope="col">{% trans "name"|capfirst %} <span class="toggle"></span></th>
<th scope="col">{% trans "registration date"|capfirst %} <span class="toggle"></span></th>
<th scope="col" data-meta="{sorter: 'date'}">{% trans "registration date"|capfirst %} <span class="toggle"></span></th>
{% if cancellations %}
<th scope="col">{% trans "cancellation date"|capfirst %} <span class="toggle"></span></th>
<th scope="col" data-meta="{sorter: 'date'}">{% trans "cancellation date"|capfirst %} <span class="toggle"></span></th>
{% endif %}
{% for field in fields %}
<th scope="col">{{ field.name }} <span class="toggle"></span></th>
......@@ -37,9 +37,9 @@
{% else %}
<td>{{ registration.name }}</td>
{% endif %}
<td>{{ registration.date }}</td>
<td data-sortval="{{ registration.date|date:'c' }}">{{ registration.date }}</td>
{% if cancellations %}
<td>{{ registration.date_cancelled }}</td>
<td data-sortval="{{ registration.date|date:'c' }}">{{ registration.date_cancelled }}</td>
{% endif %}
{% for field in registration.information_fields %}
{% if not field.value %}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment