From 041aa02b02b2974a7d6ea54eb1f89d4b480c068d Mon Sep 17 00:00:00 2001 From: Andreas <6977712+AndreasK79@users.noreply.github.com> Date: Wed, 26 Apr 2023 20:33:45 +0200 Subject: [PATCH] [OQRS] Fixed time formatting. Added datatable and submit with enter on search. --- application/views/oqrs/index.php | 15 +++++++++++++++ assets/js/sections/oqrs.js | 19 +++++++++++++++++++ 2 files changed, 34 insertions(+) diff --git a/application/views/oqrs/index.php b/application/views/oqrs/index.php index 18e8cda0..7eb78fb6 100644 --- a/application/views/oqrs/index.php +++ b/application/views/oqrs/index.php @@ -22,6 +22,21 @@ '; echo '
'; + ?> + + '; if ($stations->result() != NULL) { ?> diff --git a/assets/js/sections/oqrs.js b/assets/js/sections/oqrs.js index 0506ae17..8440ea8b 100644 --- a/assets/js/sections/oqrs.js +++ b/assets/js/sections/oqrs.js @@ -49,6 +49,25 @@ function searchOqrsGrouped() { data: {'callsign': $("#oqrssearch").val().toUpperCase()}, success: function (data) { $(".searchinfo").append(data); + $('.qsotime').change(function() { + var raw_time = $(this).val(); + if(raw_time.match(/^\d\[0-6]d$/)) { + raw_time = "0"+raw_time; + } + if(raw_time.match(/^[012]\d[0-5]\d$/)) { + raw_time = raw_time.substring(0,2)+":"+raw_time.substring(2,4); + $(this).val(raw_time); + } + }); + $('.result-table').DataTable({ + "pageLength": 25, + responsive: false, + ordering: false, + "scrollY": "410px", + "scrollCollapse": true, + "paging": false, + "scrollX": true, + }); } }); }