微调
This commit is contained in:
@@ -109,7 +109,7 @@ const timeUnits = ref<TimeUnit[]>(
|
||||
// 发出日期变化事件
|
||||
const emitDateChange = () => {
|
||||
emit('update-dates', formatDate(startDate.value), formatDate(endDate.value))
|
||||
//console.log('emitDateChange', startDate.value, endDate.value)
|
||||
|
||||
}
|
||||
|
||||
// 在组件挂载时更新日期范围
|
||||
@@ -138,7 +138,7 @@ const updateDateRange = () => {
|
||||
} else if (timeUnit.value === '周') {
|
||||
startDate.value = getStartOfWeek(today.value)
|
||||
endDate.value = getEndOfWeek(today.value)
|
||||
//console.log(endDate.value.toLocaleDateString())
|
||||
|
||||
} else if (timeUnit.value === '月') {
|
||||
// 获取本月的开始和结束日期
|
||||
startDate.value = new Date(today.value.getFullYear(), today.value.getMonth(), 1);
|
||||
@@ -167,7 +167,7 @@ const updateDateRange = () => {
|
||||
|
||||
// // 确保结束日期不超过今天
|
||||
// if (endDate.value > today.value) {
|
||||
// console.log("1111")
|
||||
|
||||
// endDate.value = new Date(today.value);
|
||||
// endDate.value.setHours(23, 59, 59, 999); // 设置结束时间为今天的23:59:59.999
|
||||
// }
|
||||
@@ -258,7 +258,7 @@ const nextPeriod = () => {
|
||||
updateNextButtonStatus()
|
||||
}
|
||||
const updateNextButtonStatus = () => {
|
||||
//console.log(endDate.value)
|
||||
|
||||
// 更新下一个按钮的禁用状态
|
||||
const maxDate = new Date() // 假设最新日期为今天
|
||||
// 将 maxDate 设置为当天的开始时间
|
||||
|
||||
Reference in New Issue
Block a user