Browse Source

fix:时间边界

zhangrenyuan/feature-20250728113353-金币前端三期
lihui 1 week ago
parent
commit
633e3d2b7b
  1. 44
      src/views/refund/gold/coinRefundDetail.vue

44
src/views/refund/gold/coinRefundDetail.vue

@ -6,6 +6,7 @@ import moment from 'moment'
import API from '@/util/http.js'
import request from '@/util/http.js'
import {reverseMarketMapping} from "@/utils/marketMap.js";
import dayjs from "dayjs";
const defaultTime = [
new Date(2000, 1, 1, 0, 0, 0),
@ -200,17 +201,9 @@ const reset = function () {
}
//
const getToday = function () {
const today = new Date()
const startTime = new Date(
today.getFullYear(),
today.getMonth(),
today.getDate()
)
const endTime = new Date(
today.getFullYear(),
today.getMonth(),
today.getDate() + 1
)
const today = dayjs()
const startTime = today.startOf('day').format('YYYY-MM-DD HH:mm:ss')
const endTime =today.endOf('day').format('YYYY-MM-DD HH:mm:ss')
getTime.value = [startTime, endTime]
console.log('getTime', getTime.value)
activeTimeRange.value = 'today' //
@ -219,18 +212,9 @@ const getToday = function () {
}
//
const getYesterday = function () {
const yesterday = new Date()
yesterday.setDate(yesterday.getDate() - 1)
const startTime = new Date(
yesterday.getFullYear(),
yesterday.getMonth(),
yesterday.getDate()
)
const endTime = new Date(
yesterday.getFullYear(),
yesterday.getMonth(),
yesterday.getDate() + 1
)
const today = dayjs()
const startTime = today.subtract(1, 'day').startOf('day').format('YYYY-MM-DD HH:mm:ss')
const endTime = today.subtract(1, 'day').endOf('day').format('YYYY-MM-DD HH:mm:ss')
getTime.value = [startTime, endTime]
console.log('getTime', getTime.value)
activeTimeRange.value = 'yesterday' //
@ -239,17 +223,9 @@ const getYesterday = function () {
}
// 7
const get7Days = function () {
const today = new Date()
const startTime = new Date(
today.getFullYear(),
today.getMonth(),
today.getDate() - 6
)
const endTime = new Date(
today.getFullYear(),
today.getMonth(),
today.getDate() + 1
)
const today = dayjs()
const startTime = today.subtract(6, 'day').startOf('day').format('YYYY-MM-DD HH:mm:ss')
const endTime = today.add(1, 'day').endOf('day').format('YYYY-MM-DD HH:mm:ss')
getTime.value = [startTime, endTime]
console.log('getTime', getTime.value)
activeTimeRange.value = '7days' //

Loading…
Cancel
Save