From 5c9a7f52f876174cccac34e493524b30bf9fdc89 Mon Sep 17 00:00:00 2001 From: PatchesMaps Date: Wed, 13 Nov 2024 15:17:31 -0500 Subject: [PATCH] Allow zero-length ranges to be rendered --- .../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) {