This commit is contained in:
sjl
2024-11-14 18:26:34 +08:00
parent 65cb7826d3
commit 87fe66da3e
42 changed files with 188 additions and 204 deletions

View File

@@ -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 设置为当天的开始时间