Skip to content

Commit

Permalink
Fix another one
Browse files Browse the repository at this point in the history
  • Loading branch information
conbrad committed Jul 26, 2023
1 parent bf74799 commit 250a181
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions web/src/features/moreCast2/slices/dataSlice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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] = []
}
}
Expand Down

0 comments on commit 250a181

Please sign in to comment.