Browse Source

HUE-9485 [frontend] Fix bug in the Duration component

Johan Ahlen 5 years ago
parent
commit
7d572fdb40
1 changed files with 2 additions and 2 deletions
  1. 2 2
      desktop/core/src/desktop/js/components/Duration.vue

+ 2 - 2
desktop/core/src/desktop/js/components/Duration.vue

@@ -40,9 +40,9 @@
     const luxonDuration = LuxonDuration.fromMillis(value);
     if (short) {
       for (const limit of SHORT_LIMITS) {
-        const val = luxonDuration.as(limit.unit);
+        const val = Math.floor(luxonDuration.as(limit.unit));
         if (val >= 1) {
-          return Math.floor(val) + I18n(limit.postfix + (limit.appendS && val > 1 ? 's' : ''));
+          return val + I18n(limit.postfix + (limit.appendS && val > 1 ? 's' : ''));
         }
       }
       return `0${I18n('ms')}`;