From d1066ba6245e945e8e98190a1dcce6e511c8f54d Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Sun, 30 Apr 2023 16:22:37 +0200 Subject: [PATCH] Use Math.round instead of parseInt when parsing durations. --- platypush/backend/http/webapp/src/utils/Types.vue | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/platypush/backend/http/webapp/src/utils/Types.vue b/platypush/backend/http/webapp/src/utils/Types.vue index cab283c6cb..809ae76de5 100644 --- a/platypush/backend/http/webapp/src/utils/Types.vue +++ b/platypush/backend/http/webapp/src/utils/Types.vue @@ -43,9 +43,9 @@ export default { const ret = [] time = parseFloat(time); // Normalize strings - t.d = parseInt(time/86400) - t.h = parseInt(time/3600 - t.d*24) - t.m = parseInt(time/60 - (t.d*24 + t.h*60)) + t.d = Math.round(time/86400) + t.h = Math.round(time/3600 - t.d*24) + t.m = Math.round(time/60 - (t.d*24 + t.h*60)) t.s = Math.round(time - (t.d*24 + t.h*3600 + t.m*60), 1) if (parseInt(t.d)) {