This is an automated email from the ASF dual-hosted git repository.
benjobs pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/incubator-streampark.git
The following commit(s) were added to refs/heads/dev by this push:
new bee3ea9d2 [Bug] Fix the wrong duration (#1585)
bee3ea9d2 is described below
commit bee3ea9d275b89ce6658ec4aa0243ff3f21b00fb
Author: 1996fanrui <[email protected]>
AuthorDate: Tue Sep 13 17:19:29 2022 +0800
[Bug] Fix the wrong duration (#1585)
---
streampark-console/streampark-console-webapp/src/utils/filter.js | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/streampark-console/streampark-console-webapp/src/utils/filter.js
b/streampark-console/streampark-console-webapp/src/utils/filter.js
index fa86e13b0..29b074399 100644
--- a/streampark-console/streampark-console-webapp/src/utils/filter.js
+++ b/streampark-console/streampark-console-webapp/src/utils/filter.js
@@ -45,10 +45,10 @@ Vue.filter('duration', function duration (ms) {
const hh = mi * 60
const dd = hh * 24
- const day = parseFloat(ms / dd).toFixed(0)
- const hour = parseFloat((ms - day * dd) / hh).toFixed(0)
- const minute = parseFloat((ms - day * dd - hour * hh) / mi).toFixed(0)
- const seconds = parseFloat((ms - day * dd - hour * hh - minute * mi) /
ss).toFixed(0)
+ const day = Math.floor(ms / dd)
+ const hour = Math.floor((ms - day * dd) / hh)
+ const minute = Math.floor((ms - day * dd - hour * hh) / mi)
+ const seconds = Math.floor((ms - day * dd - hour * hh - minute * mi) / ss)
if (day > 0) {
return day + 'd ' + hour + 'h ' + minute + 'm ' + seconds + 's'
} else if (hour > 0) {