♻️ set default start time to 7 days ago

This commit is contained in:
Fred KISSIE
2025-12-08 23:56:28 +01:00
parent e0a79b7d4d
commit adf76bfb53
6 changed files with 50 additions and 56 deletions

View File

@@ -47,19 +47,12 @@ import {
TooltipProvider,
TooltipTrigger
} from "./ui/tooltip";
import { getSevenDaysAgo } from "@app/lib/getSevenDaysAgo";
export type AnalyticsContentProps = {
orgId: string;
};
function getSevenDaysAgo() {
const today = new Date();
today.setHours(0, 0, 0, 0); // Set to midnight
const sevenDaysAgo = new Date(today);
sevenDaysAgo.setDate(today.getDate() - 7);
return sevenDaysAgo;
}
export function LogAnalyticsData(props: AnalyticsContentProps) {
const searchParams = useSearchParams();
const path = usePathname();