]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
baculum: Fix #2562 displaying date and time in tables on Safari
authorMarcin Haba <marcin.haba@bacula.pl>
Thu, 10 Sep 2020 09:06:26 +0000 (11:06 +0200)
committerMarcin Haba <marcin.haba@bacula.pl>
Thu, 10 Sep 2020 09:06:26 +0000 (11:06 +0200)
gui/baculum/protected/Common/Class/BClientScript.php
gui/baculum/protected/Web/JavaScript/misc.js

index fb66d391132d172981720de1ab3ccea63a590b6a..0abd06e61655be45d90c751f5a630a63331e524e 100644 (file)
@@ -31,7 +31,7 @@ Prado::using('System.Web.UI.WebControls.TClientScript');
  */
 class BClientScript extends TClientScript {
 
-       const SCRIPTS_VERSION = 9;
+       const SCRIPTS_VERSION = 10;
 
        public function getScriptUrl()
        {
index f43666662c5421dcdc792967ce739d20b29bcc89..e396988f4992676125985e0826bf62f7e0eff979 100644 (file)
@@ -286,7 +286,10 @@ var Formatters = {
 function render_date(data, type, row) {
        var t = data;
        if (t) {
-               var d = (new Date(t)).getTime();
+               var dati = t.split(' ');
+               var da = dati[0].split('-');
+               var ti = dati[1].split(':');
+               var d = (new Date(da[0], (da[1] - 1), da[2], ti[0], ti[1], ti[2], 0)).getTime();
                if (type == 'display') {
                        t = Units.format_date(d);
                } else {