This commit is contained in:
2026-06-04 11:46:32 +08:00
parent ff61e815d8
commit cdf8b1f76d
4 changed files with 192 additions and 293 deletions
+3 -1
View File
@@ -1,4 +1,4 @@
export type ListTimeType = 'today' | 'yesterday' | 'week' | 'month' | 'custom'
export type ListTimeType = 'all' | 'today' | 'yesterday' | 'week' | 'month' | 'custom'
export function formatYmd(d: Date): string {
const y = d.getFullYear()
@@ -12,6 +12,8 @@ export function resolveListTimeRange(timeType: ListTimeType, dateRange: string[]
const today = formatYmd(new Date())
switch (timeType) {
case 'all':
return ['', '']
case 'yesterday': {
const d = new Date()
d.setDate(d.getDate() - 1)