From 250a181ac7a3df8bb8d0d557419411be6910d3d3 Mon Sep 17 00:00:00 2001 From: Conor Brady Date: Wed, 26 Jul 2023 15:42:18 -0700 Subject: [PATCH] Fix another one --- web/src/features/moreCast2/slices/dataSlice.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/web/src/features/moreCast2/slices/dataSlice.ts b/web/src/features/moreCast2/slices/dataSlice.ts index 4d0ff88dc..5ad24fbab 100644 --- a/web/src/features/moreCast2/slices/dataSlice.ts +++ b/web/src/features/moreCast2/slices/dataSlice.ts @@ -14,7 +14,7 @@ import { createDateInterval, rowIDHasher } from 'features/moreCast2/util' import { DateTime } from 'luxon' import { logError } from 'utils/error' import { MoreCast2Row } from 'features/moreCast2/interfaces' -import { groupBy, isEqual, isNumber, isUndefined } from 'lodash' +import { groupBy, isEqual, isNull, isNumber, isUndefined } from 'lodash' import { StationGroupMember } from 'api/stationAPI' interface State { @@ -385,9 +385,10 @@ const createStationCodeToWeatherIndeterminateGroups = ( } const createUtcTimeStampToWeatherIndeterminateGroups = (items: WeatherIndeterminate[], dateInterval: string[]) => { - const grouped = groupBy(items, 'utc_timestamp') + const grouped = groupBy(items, item => DateTime.fromISO(item.utc_timestamp).toISODate()) for (const date of dateInterval) { - if (isUndefined(grouped[date])) { + const isoDate = DateTime.fromISO(date).toISODate() + if (isNull(isoDate) || isUndefined(grouped[isoDate])) { grouped[date] = [] } }