fix: refactor time range to single source of truth with correct dates
- Default range changed from 30d to 7d - Presets (today/7d/30d) now directly set customStart/customEnd dates, eliminating duplicate getTimeRange() calculation - "All" preset fetches actual data boundaries from /api/date-range and backfills the custom date picker - Clicking "custom" opens popover without triggering data refresh; only confirm applies changes - SQL trend dates cast to ::text to avoid pg driver Date timezone offset - Fix created_at filter from < to <= for end timestamp
This commit is contained in:
7
app/api/date-range/route.ts
Normal file
7
app/api/date-range/route.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
import { NextResponse } from "next/server";
|
||||
import { getDateRange } from "@/lib/queries";
|
||||
|
||||
export async function GET() {
|
||||
const data = await getDateRange();
|
||||
return NextResponse.json(data);
|
||||
}
|
||||
Reference in New Issue
Block a user