diff --git a/.github/workflows/api.yml b/.github/workflows/api.yml index 8b67ef6c0..f583da1b0 100644 --- a/.github/workflows/api.yml +++ b/.github/workflows/api.yml @@ -18,6 +18,10 @@ jobs: steps: - uses: actions/checkout@v4 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} - name: Install Poetry uses: snok/install-poetry@v1 with: diff --git a/frontend/src/components/MapView/DateSelector/index.tsx b/frontend/src/components/MapView/DateSelector/index.tsx index 3ef66dd32..9c520eb5b 100644 --- a/frontend/src/components/MapView/DateSelector/index.tsx +++ b/frontend/src/components/MapView/DateSelector/index.tsx @@ -181,9 +181,9 @@ const DateSelector = memo(() => { if (firstIndex === -1) { return layer.dateItems; } - // truncate the date item array at index matching timeline first date + // truncate the date item array at index matching timeline first date with a buffer of 1 day decrements // eslint-disable-next-line fp/no-mutating-methods - return layer.dateItems.slice(firstIndex); + return layer.dateItems.slice(firstIndex - 1); }), ]; }, [orderedLayers, timelineStartDate]); @@ -365,13 +365,13 @@ const DateSelector = memo(() => { return; } const time = date.getTime(); - const selectedIndex = findDateIndex(selectableDates, date.getTime()); + const selectedIndex = findDateIndex(availableDates, date.getTime()); checkSelectedDateForLayerSupport(date.getTime()); if ( selectedIndex < 0 || (stateStartDate && datesAreEqualWithoutTime( - selectableDates[selectedIndex], + availableDates[selectedIndex], stateStartDate, )) ) { @@ -381,7 +381,7 @@ const DateSelector = memo(() => { dispatch(updateDateRange({ startDate: time })); }, [ - selectableDates, + availableDates, checkSelectedDateForLayerSupport, stateStartDate, updateHistory, @@ -396,6 +396,7 @@ const DateSelector = memo(() => { isUpdatingHistory: boolean, ) => { const selectedIndex = findDateIndex(availableDates, date); + if (availableDates[selectedIndex + increment]) { updateStartDate( new Date(availableDates[selectedIndex + increment]),