Преглед на файлове

HUE-4743 [editor] Queries don't need to have ms in the time counter(do not show more than 2 digits for precision)

Adrian Yavorskyy преди 8 години
родител
ревизия
5bb4b05
променени са 2 файла, в които са добавени 2 реда и са изтрити 1 реда
  1. 1 0
      desktop/core/src/desktop/static/desktop/js/hue.utils.js
  2. 1 1
      desktop/core/src/desktop/static/desktop/spec/hueUtilsSpec.js

+ 1 - 0
desktop/core/src/desktop/static/desktop/js/hue.utils.js

@@ -530,6 +530,7 @@ Number.prototype.toHHMMSS = function (skipZeroSeconds) {
   var n = this;
   var n = this;
   var millis = n % 1000;
   var millis = n % 1000;
   n = (n - millis) / 1000;
   n = (n - millis) / 1000;
+  millis = +((millis / 1000).toFixed(2)) * 100;
   var seconds = n % 60;
   var seconds = n % 60;
   n = (n - seconds) / 60;
   n = (n - seconds) / 60;
   var minutes = n % 60;
   var minutes = n % 60;

+ 1 - 1
desktop/core/src/desktop/static/desktop/spec/hueUtilsSpec.js

@@ -21,7 +21,7 @@
     });
     });
 
 
     it("should show the milliseconds in number format if the time is less than 60 seconds", function() {
     it("should show the milliseconds in number format if the time is less than 60 seconds", function() {
-      expect(Number(10123).toHHMMSS()).toEqual('10.123s');
+      expect(Number(10123).toHHMMSS()).toEqual('10.12s');
     });
     });
 
 
     it("should skip the seconds if it's zero and it's specified in the function", function() {
     it("should skip the seconds if it's zero and it's specified in the function", function() {