Skip to content

Commit 4d8c9f4

Browse files
committed
Tidy up year filter
Most trees have no year data, so the previous filtering would result in many trees vanishing when filtering was applied
1 parent 2c89ec1 commit 4d8c9f4

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

‎templates/hfxtrees/index.html‎

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -609,11 +609,9 @@ <h4><i class="fas fa-filter"></i> Filters <i class="fas fa-chevron-down filter-t
609609
if (p.c !== commonNameVal) return false;
610610
}
611611

612-
// Year filter
613-
if (yearActive) {
614-
var yr = p.y;
615-
if (!yr || yr < 2013 || yr > 2025) return false;
616-
if (yr < yearMin || yr > yearMax) return false;
612+
// Year filter (skip trees with no year data)
613+
if (yearActive && p.y) {
614+
if (p.y < yearMin || p.y > yearMax) return false;
617615
}
618616

619617
// DBH filter

0 commit comments

Comments
 (0)