fix(frontend): 修复跨时区日期范围筛选问题

当管理员在比服务器时区更早的时区(如芝加哥 UTC-6)访问使用记录页面时,
由于服务器时区(如中国 UTC+8)已经是"明天",导致最新的记录无法显示。

修复方案:
- DateRangePicker: 将日期选择器的 max 限制从"今天"改为"明天"
- UsageView: 默认和重置时的 endDate 使用"明天"而非"今天"

这样可以确保跨时区场景下用户能看到所有最新记录。

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Yuhao Jiang
2026-01-03 21:04:34 -06:00
parent 631ba25e04
commit 600f9ce254
2 changed files with 19 additions and 5 deletions

View File

@@ -59,7 +59,7 @@
<input
type="date"
v-model="localStartDate"
:max="localEndDate || today"
:max="localEndDate || tomorrow"
class="date-picker-input"
@change="onDateChange"
/>
@@ -85,7 +85,7 @@
type="date"
v-model="localEndDate"
:min="localStartDate"
:max="today"
:max="tomorrow"
class="date-picker-input"
@change="onDateChange"
/>
@@ -144,6 +144,14 @@ const today = computed(() => {
return `${year}-${month}-${day}`
})
// Tomorrow's date - used for max date to handle timezone differences
// When user is in a timezone behind the server, "today" on server might be "tomorrow" locally
const tomorrow = computed(() => {
const d = new Date()
d.setDate(d.getDate() + 1)
return formatDateToString(d)
})
// Helper function to format date to YYYY-MM-DD using local timezone
const formatDateToString = (date: Date): string => {
const year = date.getFullYear()