Skip to content

Commit

Permalink
Fix date comparison, delete old cold
Browse files Browse the repository at this point in the history
  • Loading branch information
conbrad committed Jul 26, 2023
1 parent f84e798 commit bf74799
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 15 deletions.
13 changes: 0 additions & 13 deletions web/src/features/moreCast2/components/TabbedDataGrid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,19 +31,6 @@ export const SaveButton = styled(SaveForecastButton)(({ theme }) => ({
right: theme.spacing(2)
}))

// const Root = styled('div')(({ theme }) => ({
// [`& .${classes.root}`]: {
// display: 'flex',
// flexGrow: 1,
// flexDirection: 'column'
// },

// [`& .${classes.saveButton}`]: {
// position: 'absolute',
// right: theme.spacing(2)
// }
// }))

const FORECAST_ERROR_MESSAGE = 'The forecast was not saved; an unexpected error occurred.'
const FORECAST_SAVED_MESSAGE = 'Forecast was successfully saved and sent to Wildfire One.'
const FORECAST_WARN_MESSAGE = 'Forecast not submitted. A forecast can only contain N/A values for the Wind Direction.'
Expand Down
4 changes: 2 additions & 2 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, isNumber, isUndefined } from 'lodash'
import { groupBy, isEqual, isNumber, isUndefined } from 'lodash'
import { StationGroupMember } from 'api/stationAPI'

interface State {
Expand Down Expand Up @@ -308,7 +308,7 @@ export const fillMissingWeatherIndeterminates = (
// We expect one actual per date in our date interval
if (values.length < dateInterval.length) {
for (const date of dateInterval) {
if (!values.some(value => value.utc_timestamp === date)) {
if (!values.some(value => isEqual(DateTime.fromISO(value.utc_timestamp), DateTime.fromISO(date)))) {
const missing = createEmptyWeatherIndeterminate(stationCode, stationName, date, determinate)
weatherIndeterminates.push(missing)
}
Expand Down

0 comments on commit bf74799

Please sign in to comment.