diff --git a/static/chart_main/sevencoin.js b/static/chart_main/sevencoin.js index f78db59..ddd7b0b 100644 --- a/static/chart_main/sevencoin.js +++ b/static/chart_main/sevencoin.js @@ -253,8 +253,8 @@ $(function () { tvQuoter.find('[data-name="zhangdiee"]').css('color',zhangdiee>0?'#53b987':'#eb4d5c'); } timestampToTime(timestamp) { - const date = new Date(timestamp); - const getHours = date.getHours() > 12 ? date.getHours() - 12 : date.getHours() + 12 + const dates = new Date(timestamp); + const date = this.adjustToEasternTime(dates); const yyyy = `${date.getFullYear()}`; const yy = `${date.getFullYear()}`.substr(2); @@ -273,6 +273,24 @@ $(function () { } return dateStr } + + adjustToEasternTime(date) { + // 将给定日期转换为时间戳 + const timestamp = date.getTime(); + + // 获取美国东部时区偏移值(以分钟为单位) + const easternOffset = -240; // 美国东部时区偏移值为 -240 分钟 + + // 调整时间为美国东部时间 + const adjustedTime = timestamp - (date.getTimezoneOffset() + easternOffset) * 60 * 1000; + + // 创建新的日期对象,并使用调整后的时间戳 + const adjustedDate = new Date(adjustedTime); + + // 返回调整后的日期对象 + return adjustedDate; + } + getResolutionTime() { const resolution = this.TView.chart().resolution(); switch (resolution) { diff --git a/static/img/cs_w.svg b/static/img/cs_w.svg deleted file mode 100644 index 5615935..0000000 --- a/static/img/cs_w.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file