From 9d8ed7be13a6b9339db434f1d50d606ac8f67d68 Mon Sep 17 00:00:00 2001 From: Patrick Moulden <4834892+PatchesMaps@users.noreply.github.com> Date: Wed, 27 Nov 2024 16:23:33 -0500 Subject: [PATCH] Allow zero-length ranges to be rendered (#5565) --- .../timeline/timeline-coverage/coverage-item-container.js | 2 +- .../timeline/timeline-coverage/coverage-item-list.js | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/web/js/components/timeline/timeline-coverage/coverage-item-container.js b/web/js/components/timeline/timeline-coverage/coverage-item-container.js index 3f188c7bef..935147c722 100644 --- a/web/js/components/timeline/timeline-coverage/coverage-item-container.js +++ b/web/js/components/timeline/timeline-coverage/coverage-item-container.js @@ -72,7 +72,7 @@ class CoverageItemContainer extends Component { dateIntervalStartDates.forEach((dateIntStartDate) => { const dateIntTime = new Date(dateIntStartDate).getTime(); // allow overwriting of subsequent date ranges - if (dateIntTime >= startDateTime && dateIntTime < endDateTime) { + if (dateIntTime >= startDateTime && dateIntTime <= endDateTime) { const dateIntFormatted = dateIntStartDate.toISOString(); multiCoverageDates[dateIntFormatted] = { date: dateIntFormatted, diff --git a/web/js/components/timeline/timeline-coverage/coverage-item-list.js b/web/js/components/timeline/timeline-coverage/coverage-item-list.js index 0c797f1f5c..0dd9349b39 100644 --- a/web/js/components/timeline/timeline-coverage/coverage-item-list.js +++ b/web/js/components/timeline/timeline-coverage/coverage-item-list.js @@ -262,9 +262,7 @@ class CoverageItemList extends Component { const endGreaterThanOrEqualToStartDateLimit = new Date(rangeEnd).getTime() >= startDateLimit.getTime(); if (startLessThanOrEqualToEndDateLimit && endGreaterThanOrEqualToStartDateLimit) { // check layer date array cache and use caches date array if available, if not add date array - if (!this.layerDateArrayCache[id]) { - this.layerDateArrayCache[id] = {}; - } + this.layerDateArrayCache[id] ??= {}; const layerIdDates = `${appNow.toISOString()}-${frontDate}-${backDate}`; if (this.layerDateArrayCache[id][layerIdDates] === undefined) {