feat: implement last 24 hours date range preset and update filters in UsageView
This commit is contained in:
@@ -106,7 +106,7 @@ const isOpen = ref(false)
|
||||
const containerRef = ref<HTMLElement | null>(null)
|
||||
const localStartDate = ref(props.startDate)
|
||||
const localEndDate = ref(props.endDate)
|
||||
const activePreset = ref<string | null>('7days')
|
||||
const activePreset = ref<string | null>('last24Hours')
|
||||
|
||||
const today = computed(() => {
|
||||
// Use local timezone to avoid UTC timezone issues
|
||||
@@ -152,6 +152,18 @@ const presets: DatePreset[] = [
|
||||
return { start: yesterday, end: yesterday }
|
||||
}
|
||||
},
|
||||
{
|
||||
labelKey: 'dates.last24Hours',
|
||||
value: 'last24Hours',
|
||||
getRange: () => {
|
||||
const end = new Date()
|
||||
const start = new Date(end.getTime() - 24 * 60 * 60 * 1000)
|
||||
return {
|
||||
start: formatDateToString(start),
|
||||
end: formatDateToString(end)
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
labelKey: 'dates.last7Days',
|
||||
value: '7days',
|
||||
|
||||
Reference in New Issue
Block a user