From 209c26e699ba9b5f12855772b59618ce1a423da9 Mon Sep 17 00:00:00 2001
From: xc <double72cheng@gmail.com>
Date: Mon, 16 Aug 2021 17:31:26 +0800
Subject: [PATCH] add
---
src/main/resources/public/js/jquery.progressTime.js | 12 +++++++++---
1 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/src/main/resources/public/js/jquery.progressTime.js b/src/main/resources/public/js/jquery.progressTime.js
index 4143011..b5e9d08 100644
--- a/src/main/resources/public/js/jquery.progressTime.js
+++ b/src/main/resources/public/js/jquery.progressTime.js
@@ -162,10 +162,16 @@
typeof this.options.callback === "function" && this.options.callback(config);
}
ProgressTime.prototype.setTime = function (e) {
- var layerX = e && e.originalEvent.layerX;
- var type = e && e.type;
+ var layerX= e && e.originalEvent.layerX;
+ var type=e && e.type;;
+ var tooltipTimestamp;
+ if (e&&e.timer){
+ let timer = new Date(formatDate(new Date(e.timer), "YYYY/MM/DD HH:00:00"));
+ tooltipTimestamp=timer;
+ }else {
+ tooltipTimestamp = this.currentTimeTemp || this.currentTime.getTime(); // 返回当前的时间的时间戳
+ }
var hoursWidth = $("." + this.id + "-center-t-ul li")[0].getBoundingClientRect().width / 24; // 计算每个小时所占的宽度
- var tooltipTimestamp = this.currentTimeTemp || this.currentTime.getTime(); // 返回当前的时间的时间戳
var num = Math.floor((tooltipTimestamp - this.startTime.getTime()) / hourTimestamp); // 计算出多少小时
num = layerX !== undefined ? Math.round(layerX / hoursWidth) : num;
var progressWidth = num * hoursWidth; // 计算出时间条的长度
--
Gitblit v1.9.1