Skip to content

Commit

Permalink
time fix
Browse files Browse the repository at this point in the history
  • Loading branch information
brettedw committed Feb 13, 2024
1 parent 344af84 commit 2b0a70b
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import {
} from '@mui/x-data-grid'
import { ModelChoice } from 'api/moreCast2API'
import { createWeatherModelLabel } from 'features/moreCast2/util'
import { DateTime } from 'luxon'

const NOT_AVAILABLE = 'N/A'

Expand Down Expand Up @@ -66,9 +65,13 @@ export class GridComponentRenderer {
// We need the prefix to help us grab the correct 'actual' field (eg. tempACTUAL, precipACTUAL, etc.)
const actualField = this.getActualField(field)
const isActual = !isNaN(params.row[actualField])
const isPreviousDate = params.row['forDate'] < DateTime.now()

const isGrassField = field.includes('grass')
// We can disable to field if an Actual exists or the forDate is before today.
// Both forDate and today are currently in the system's time zone
const today = new Date()
today.setHours(0, 0, 0, 0)
const isPreviousDate = params.row['forDate'] < today

return (
<TextField
Expand Down

0 comments on commit 2b0a70b

Please sign in to comment.