Skip to content

Commit ad0f8e7

Browse files
committed
add: checks before using start time and end time
1 parent c255d07 commit ad0f8e7

File tree

1 file changed

+17
-6
lines changed

1 file changed

+17
-6
lines changed

web/src/components/dashboards/PanelSchemaRenderer.vue

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -586,12 +586,23 @@ export default defineComponent({
586586
const drilldownVariables: any = {};
587587
588588
// selected start time and end time
589-
drilldownVariables.start_time = new Date(
590-
selectedTimeObj.value.start_time.toISOString()
591-
).getTime();
592-
drilldownVariables.end_time = new Date(
593-
selectedTimeObj.value.end_time.toISOString()
594-
).getTime();
589+
if (
590+
selectedTimeObj?.value?.start_time &&
591+
selectedTimeObj?.value?.start_time != "Invalid Date"
592+
) {
593+
drilldownVariables.start_time = new Date(
594+
selectedTimeObj?.value?.start_time?.toISOString()
595+
).getTime();
596+
}
597+
598+
if (
599+
selectedTimeObj?.value?.end_time &&
600+
selectedTimeObj?.value?.end_time != "Invalid Date"
601+
) {
602+
drilldownVariables.end_time = new Date(
603+
selectedTimeObj?.value?.end_time?.toISOString()
604+
).getTime();
605+
}
595606
596607
// if chart type is 'table' then we need to pass the table name
597608
if (panelSchema.value.type == "table") {

0 commit comments

Comments
 (0)