Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/openstatusHQ/openstatus. ๐ซ Status page with uptime monitoring & API monitoring as code ๐ซ openstatus.dev
bun drizzle-orm monitoring monitoring-as-code nextjs observability on-call open-source shadcn-ui status-page statuspage synthetic-monitoring tinybird turso uptime uptime-checker uptime-monitor
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142import { DatePreset } from "@openstatus/ui/components/data-table-filters/types";import { addDays, addHours, endOfDay, startOfDay } from "date-fns";
export const presets = [ { label: "Today", from: startOfDay(new Date()), to: endOfDay(new Date()), shortcut: "d", // day }, { label: "Yesterday", from: startOfDay(addDays(new Date(), -1)), to: endOfDay(addDays(new Date(), -1)), shortcut: "y", }, { label: "Last hour", from: addHours(new Date(), -1), to: new Date(), shortcut: "h", }, { label: "Last 7 days", from: startOfDay(addDays(new Date(), -7)), to: endOfDay(new Date()), shortcut: "w", }, { label: "Last 14 days", from: startOfDay(addDays(new Date(), -14)), to: endOfDay(new Date()), shortcut: "b", // bi-weekly }, { label: "Last 30 days", from: startOfDay(addDays(new Date(), -30)), to: endOfDay(new Date()), shortcut: "m", },] satisfies DatePreset[];