Changeset:
        836f12a17665
        
https://sourceforge.net/p/mrbs/hg-code/ci/836f12a17665b74111fb39baaf0268caa4d4f814
Author:
        Campbell Morrison <[email protected]>
Date:
        Sat Jun 03 05:58:49 2017 +0100
Log message:

Added sorting by the real date on the timestamp column in the users table.

diffstat:

 web/edit_users.php |  12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)

diffs (29 lines):

diff -r 666f5a0c7bd3 -r 836f12a17665 web/edit_users.php
--- a/web/edit_users.php        Thu Jun 01 23:09:28 2017 +0100
+++ b/web/edit_users.php        Sat Jun 03 05:58:49 2017 +0100
@@ -172,8 +172,15 @@
                       "</div>\n";
           break;
         case 'timestamp':
-          // Convert the SQL timestamp into a time value and back into a 
localised string
-          $values[] = time_date_string(strtotime($col_value));
+          // Convert the SQL timestamp into a time value and back into a 
localised string and
+          // put the UNIX timestamp in a span so that the JavaScript can sort 
it properly.
+          $unix_timestamp = strtotime($col_value);
+          if ($unix_timestamp === false)
+          {
+            // To cater for timestamps before the start of the Unix Epoch
+            $unix_timestamp = 0;
+          }
+          $values[] = "<span title=\"$unix_timestamp\"></span>" . 
time_date_string($unix_timestamp);
           break;
         default:
           // Where there's an associative array of options, display
@@ -871,6 +878,7 @@
         switch ($fieldname)
         {
           case 'level':
+          case 'timestamp':
             $heading = '<span class="normal" data-type="title-numeric">' . 
$heading . '</span>';
             break;
           default:

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Mrbs-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mrbs-commits

Reply via email to