Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

fix(studio): show selected custom time range in SQL editor time range menu (#48709)

Charis89010c164903
diff --git a/apps/studio/components/interfaces/SQLEditor/UtilityPanel/QuerySourceMenu/TimeRangeSubMenu.tsx b/apps/studio/components/interfaces/SQLEditor/UtilityPanel/QuerySourceMenu/TimeRangeSubMenu.tsx
index 39517f8c7b6..f633d4a8a58 100644
--- a/apps/studio/components/interfaces/SQLEditor/UtilityPanel/QuerySourceMenu/TimeRangeSubMenu.tsx
+++ b/apps/studio/components/interfaces/SQLEditor/UtilityPanel/QuerySourceMenu/TimeRangeSubMenu.tsx
@@ -1,3 +1,4 @@
+import dayjs from 'dayjs'
import { Check, Lock } from 'lucide-react'
import {
DropdownMenuItem,
@@ -50,7 +51,9 @@ export const TimeRangeSubMenu = ({
<div className="flex flex-col">
<span>Time range</span>
<span className="text-foreground-lighter text-xs">
- {isCustomRange ? 'Custom range' : (selectedPreset?.helper.text ?? 'Custom range')}
+ {isCustomRange
+ ? `${dayjs(range.from).format('DD MMM, HH:mm')} - ${dayjs(range.to).format('DD MMM, HH:mm')}`
+ : (selectedPreset?.helper.text ?? 'Custom range')}
</span>
</div>
</DropdownMenuSubTrigger>