calculateDateRange() — supabase Function Reference
Architecture documentation for the calculateDateRange() function in useServiceHealthMetrics.utils.ts from the supabase codebase.
Entity Profile
Dependency Diagram
graph TD 60f37caf_212a_08a5_5fd3_833499e82c44["calculateDateRange()"] c356cf22_da3f_13fc_2350_53a3eed15996["useServiceHealthMetrics()"] c356cf22_da3f_13fc_2350_53a3eed15996 -->|calls| 60f37caf_212a_08a5_5fd3_833499e82c44 style 60f37caf_212a_08a5_5fd3_833499e82c44 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
apps/studio/components/interfaces/Observability/useServiceHealthMetrics.utils.ts lines 15–37
export const calculateDateRange = (
interval: '1hr' | '1day' | '7day'
): { startDate: string; endDate: string } => {
const now = dayjs()
const end = now.toISOString()
let start: string
switch (interval) {
case '1hr':
start = now.subtract(1, 'hour').toISOString()
break
case '1day':
start = now.subtract(1, 'day').toISOString()
break
case '7day':
start = now.subtract(7, 'day').toISOString()
break
default:
start = now.subtract(1, 'hour').toISOString()
}
return { startDate: start, endDate: end }
}
Domain
Subdomains
Called By
Source
Frequently Asked Questions
What does calculateDateRange() do?
calculateDateRange() is a function in the supabase codebase.
What calls calculateDateRange()?
calculateDateRange() is called by 1 function(s): useServiceHealthMetrics.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free