mall数据库文件

This commit is contained in:
comlibmb
2026-01-30 16:11:23 +08:00
parent b53d2376ff
commit cfec4a16c0
71 changed files with 11786 additions and 1009 deletions

View File

@@ -0,0 +1,15 @@
export type DateRange = { startIso: string; endIso: string }
export function computeDateRange(period: string): DateRange {
const now = new Date()
const start = new Date(now.getTime())
if (period === '7d') start.setDate(start.getDate() - 7)
else if (period === '30d') start.setDate(start.getDate() - 30)
else if (period === '90d') start.setDate(start.getDate() - 90)
else if (period === '1y') start.setFullYear(start.getFullYear() - 1)
return { startIso: start.toISOString(), endIso: now.toISOString() }
}
export function toDateOnly(iso: string): string {
return iso.length >= 10 ? iso.substring(0, 10) : iso
}