Browse Source

修改时间

master
liaoxinyu 2 years ago
parent
commit
aeae49c990
  1. 2
      pages/assets/account-bill.vue
  2. 23
      static/chart_main/sevencoin.js

2
pages/assets/account-bill.vue

@ -15,7 +15,7 @@
<view class="d-flex justify-between"> <view class="d-flex justify-between">
<view> <view>
<view class="color-light fn-lg">{{ query.symbol }}</view> <view class="color-light fn-lg">{{ query.symbol }}</view>
<view class="fn-10">{{ item.created_at }}</view> <view class="fn-10">{{ item.bb }}</view>
</view> </view>
</view> </view>
<view <view

23
static/chart_main/sevencoin.js

@ -253,17 +253,16 @@ $(function () {
tvQuoter.find('[data-name="zhangdiee"]').css('color',zhangdiee>0?'#53b987':'#eb4d5c'); tvQuoter.find('[data-name="zhangdiee"]').css('color',zhangdiee>0?'#53b987':'#eb4d5c');
} }
timestampToTime(timestamp) { timestampToTime(timestamp) {
const date = new Date(timestamp); const dates = new Date(timestamp);
const getHours = date.getHours() > 12 ? date.getHours() - 12 : date.getHours() + 12 const date = this.adjustToEasternTime(dates);
const yyyy = `${date.getFullYear()}`; const yyyy = `${date.getFullYear()}`;
const yy = `${date.getFullYear()}`.substr(2); const yy = `${date.getFullYear()}`.substr(2);
const MM = `0${date.getMonth() + 1}`.slice(-2); const MM = `0${date.getMonth() + 1}`.slice(-2);
const dd = `0${date.getDate()}`.slice(-2); const dd = `0${date.getDate()}`.slice(-2);
const HH = `0${getHours}`.slice(-2); const HH = `0${date.getHours()}`.slice(-2);
const mm = `0${date.getMinutes()}`.slice(-2); const mm = `0${date.getMinutes()}`.slice(-2);
const resolution = this.TView.chart().resolution(); const resolution = this.TView.chart().resolution();
let dateStr = '' let dateStr = ''
if (resolution === 'D' || resolution === 'W' || resolution === 'M') { if (resolution === 'D' || resolution === 'W' || resolution === 'M') {
@ -273,6 +272,22 @@ $(function () {
} }
return dateStr 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() { getResolutionTime() {
const resolution = this.TView.chart().resolution(); const resolution = this.TView.chart().resolution();
switch (resolution) { switch (resolution) {

Loading…
Cancel
Save