From 416daf0fa191376828fe22dd612916e7e7a5023a Mon Sep 17 00:00:00 2001
From: xc <double72cheng@gmail.com>
Date: Thu, 29 Apr 2021 15:53:27 +0800
Subject: [PATCH] 修改精确时间 更改时间轴
---
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