Skip to content

Commit 941671b

Browse files
committed
Update date range
1 parent 2aafcee commit 941671b

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

site/src/pages/TemplatePage/TemplateInsightsPage/TemplateInsightsPage.tsx

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ const UserLatencyPanel = (props: BoxProps) => {
8181
queryFn: () =>
8282
getInsightsUserLatency({
8383
template_ids: template.id,
84-
start_time: toTimeFilter(getTimeFor7DaysAgo()),
84+
start_time: toTimeFilter(new Date(template.created_at)),
8585
end_time: toTimeFilter(new Date()),
8686
}),
8787
})
@@ -140,7 +140,7 @@ const TemplateUsagePanel = (props: BoxProps) => {
140140
queryFn: () =>
141141
getInsightsTemplate({
142142
template_ids: template.id,
143-
start_time: toTimeFilter(getTimeFor7DaysAgo()),
143+
start_time: toTimeFilter(new Date(template.created_at)),
144144
end_time: toTimeFilter(new Date()),
145145
}),
146146
})
@@ -269,12 +269,6 @@ const NoDataAvailable = (props: BoxProps) => {
269269
)
270270
}
271271

272-
function getTimeFor7DaysAgo(): Date {
273-
const sevenDaysAgo = new Date()
274-
sevenDaysAgo.setDate(sevenDaysAgo.getDate() - 7)
275-
return sevenDaysAgo
276-
}
277-
278272
function toTimeFilter(date: Date) {
279273
date.setHours(0, 0, 0, 0)
280274
const year = date.getUTCFullYear()

0 commit comments

Comments
 (0)