Skip to content

Commit

Permalink
fixed setting activeRow when "start civil twilight" in table
Browse files Browse the repository at this point in the history
  • Loading branch information
Mattk70 committed Mar 8, 2024
1 parent c44d756 commit ca6e86a
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions js/ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -2893,12 +2893,14 @@ function onChartData(args) {
for (var i = 0; i < table.rows.length; i++) {
const row = table.rows[i];
// Get the value of the name attribute and split it on '|'
// State time is the second value in the name string
const startTime = row.getAttribute('name').split('|')[1];
// Start time is the second value in the name string
const nameAttr = row.getAttribute('name')
// no nameAttr for start civil twilight row
const startTime = nameAttr ? nameAttr.split('|')[1] : 0;

// Check if the second value matches the 'select' variable
if (parseFloat(startTime) === start) {
return i;
return i;
}
}
}
Expand Down

0 comments on commit ca6e86a

Please sign in to comment.