We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c1bf992 commit 0163b78Copy full SHA for 0163b78
static/app/views/alerts/rules/metric/details/metricChartOption.tsx
@@ -219,7 +219,8 @@ export function getMetricAlertChartOption({
219
)
220
: 0;
221
const startDate = new Date(dataArr[0]?.name);
222
- const endDate = new Date(dataArr[dataArr.length - 1]?.name);
+ const endDate =
223
+ dataArr.length > 1 ? new Date(dataArr[dataArr.length - 1]?.name) : new Date();
224
const firstPoint = startDate.getTime();
225
const lastPoint = endDate.getTime();
226
const totalDuration = lastPoint - firstPoint;
0 commit comments