diff options
author | Andrea Lepori <aleporia@gmail.com> | 2023-08-24 12:53:40 +0200 |
---|---|---|
committer | Andrea Lepori <aleporia@gmail.com> | 2023-08-24 12:53:41 +0200 |
commit | d903fb1f7417b36306c221526fd2fd987f6718c8 (patch) | |
tree | 5c3525b5fb964d5c2108a67437496cea73ec4a8c /server | |
parent | change approve direct page to show correct data (diff) | |
download | scout-subs-d903fb1f7417b36306c221526fd2fd987f6718c8.tar.gz scout-subs-d903fb1f7417b36306c221526fd2fd987f6718c8.zip |
format dates in table to be sorted
Diffstat (limited to 'server')
-rw-r--r-- | server/templates/server/doc_list_table.html | 12 | ||||
-rw-r--r-- | server/templates/server/user_list_table.html | 8 |
2 files changed, 14 insertions, 6 deletions
diff --git a/server/templates/server/doc_list_table.html b/server/templates/server/doc_list_table.html index 6a12378..860ffda 100644 --- a/server/templates/server/doc_list_table.html +++ b/server/templates/server/doc_list_table.html @@ -19,6 +19,10 @@ </div> {% endblock %} +{% block script_import %} +<script src=" https://cdn.jsdelivr.net/npm/luxon@3.4.1/build/global/luxon.min.js "></script> +{% endblock %} + {% block content %} {% load app_filter %} <form id="selection" action="{% url 'doclist-table' type_id=type_id %}" method="post"> @@ -136,12 +140,12 @@ {% endif %} type: "{{doc.document_type.name}}", code: {% if doc.status == "ok" or doc.status == "archive" %} "{{doc.code}}" {% else %} "???" {% endif %}, - compilation_date: "{{doc.compilation_date}}", + compilation_date: "{{doc.compilation_date|date:"d/m/Y"}}", capo: {% if "capi" in doc.usercode.user|user_groups %}true{% else %}false{% endif %}, name: "{{doc.usercode.first_name}}", last_name: "{{doc.usercode.last_name}}", email: "{{doc.personal_data.email}}", - birth_date: "{{doc.personal_data.born_date}}", + birth_date: "{{doc.personal_data.born_date|date:"d/m/Y"}}", branca: "{{ doc.usercode.branca }}", parent_name: "{{doc.personal_data.parent_name}}", avs_number: "{{doc.personal_data.avs_number}}", @@ -189,10 +193,10 @@ {title: "Tipo", field: "type"}, {title: "Codice", field: "code"}, {title: "Capo", field: "capo", formatter:"tickCross"}, - {title: "Data compilazione", field: "compilation_date"}, + {title: "Data compilazione", field: "compilation_date", sorter:"date"}, {title: "Branca", field: "branca"}, {title: "Email", field: "email", visible: false}, - {title: "Data di nascita", field: "birth_date", visible: false}, + {title: "Data di nascita", field: "birth_date", visible: false, sorter:"date"}, ] }, {field: "personal", name: "Informazioni personali", cols: diff --git a/server/templates/server/user_list_table.html b/server/templates/server/user_list_table.html index 624fced..98361cc 100644 --- a/server/templates/server/user_list_table.html +++ b/server/templates/server/user_list_table.html @@ -30,6 +30,10 @@ <div id="example-table"></div> {% endblock %} +{% block script_import %} +<script src=" https://cdn.jsdelivr.net/npm/luxon@3.4.1/build/global/luxon.min.js "></script> +{% endblock %} + {% block script %} $(document).ready(function(){ $('#modal1').modal(); @@ -43,7 +47,7 @@ email: "{{user.user.email}}", name: "{{user.first_name}}", last_name: "{{user.last_name}}", - birth_date: "{{user.born_date}}", + birth_date: "{{user.born_date|date:"d/m/Y"}}", branca: "{{ user.branca }}", parent_name: "{{user.parent_name}}", avs_number: "{{user.avs_number}}", @@ -87,7 +91,7 @@ {title: "Capo", field: "capo", formatter:"tickCross"}, {title: "Email", field: "email"}, {title: "Codice", field: "ucode"}, - {title: "Data di nascita", field: "birth_date"}, + {title: "Data di nascita", field: "birth_date", sorter:"date"}, {title: "Branca", field: "branca"}, ] }, |