Skip to content

Commit

Permalink
dynamic headers
Browse files Browse the repository at this point in the history
  • Loading branch information
ejimba committed Dec 11, 2023
1 parent 7383ff5 commit 8f75f06
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions html/ltr/epr.html
Original file line number Diff line number Diff line change
Expand Up @@ -230,14 +230,13 @@ <h5 class="card-title"></h5>
<thead>
<tr>
<th><b>Week</b></th>
<th class="text-right"><b>2018</b></th>
<th class="text-right"><b>2019</b></th>
<th class="text-right"><b>2020</b></th>
<th class="text-right"><b>2021</b></th>
<th class="text-right"><b>2022</b></th>
<th class="text-right"><b>Alert treshold</b></th>
<th class="text-right year-table-header"><b></b></th>
<th class="text-right year-table-header"><b></b></th>
<th class="text-right year-table-header"><b></b></th>
<th class="text-right year-table-header"><b></b></th>
<th class="text-right year-table-header"><b></b></th>
<th class="text-right"><b>Alert threshold</b></th>
<th class="text-right"><b>Action threshold</b></th>

</tr>
</thead>
<tbody>
Expand Down Expand Up @@ -331,7 +330,13 @@ <h5 class="card-title"></h5>
var sDate = $(this).val();
datePicked(sDate);
}
});
});
let currentYear = new Date().getFullYear();
let oldestYear = currentYear - 4;
let yearElements = document.querySelectorAll('.year-table-header b');
yearElements.forEach(function(elem, index) {
elem.textContent = oldestYear + index;
});
</script>
<!-- *********** end MonthPicker ************** -->
<script>
Expand Down

0 comments on commit 8f75f06

Please sign in to comment.