Skip to content

Commit

Permalink
fix typescript for @miles-grant-ibigroup
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-heppner-ibigroup committed Nov 18, 2024
1 parent d24d781 commit ac2e274
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions lib/components/form/call-taker/date-time-picker.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { connect } from 'react-redux'
import { format, toDate } from 'date-fns-tz'
import { format, OptionsWithTZ, toDate } from 'date-fns-tz'
import { getCurrentTime } from '@opentripplanner/core-utils/lib/time'
import { IntlShape, useIntl } from 'react-intl'
import { isMatch, parse } from 'date-fns'
Expand Down Expand Up @@ -60,7 +60,7 @@ const SUPPORTED_TIME_FORMATS = [
'HH:mm'
]

const safeFormat = (date: Date | '', time: string, options: any) => {
const safeFormat = (date: Date | '', time: string, options?: OptionsWithTZ) => {
if (date === '') return ''
try {
return format(date, time, options)
Expand All @@ -72,7 +72,7 @@ const safeFormat = (date: Date | '', time: string, options: any) => {

type Props = {
date?: string
departArrive?: string
departArrive?: DepartArriveValue
homeTimezone: string
onKeyDown: () => void
setQueryParam: ({
Expand Down Expand Up @@ -116,7 +116,7 @@ const DateTimeOptions = ({
timeFormat,
updateItineraryFilter
}: Props) => {
const [departArrive, setDepartArrive] = useState(
const [departArrive, setDepartArrive] = useState<DepartArriveValue>(
initialDate || initialTime ? 'DEPART' : 'NOW'
)
const [date, setDate] = useState<string | undefined>(initialDate)
Expand Down Expand Up @@ -200,12 +200,12 @@ const DateTimeOptions = ({

if (
syncSortWithDepartArrive &&
DepartArriveTypeMap[departArrive as DepartArriveValue] !== sort.type
DepartArriveTypeMap[departArrive] !== sort.type
) {
updateItineraryFilter({
sort: {
...sort,
type: DepartArriveTypeMap[departArrive as DepartArriveValue]
type: DepartArriveTypeMap[departArrive]
}
})
}
Expand All @@ -231,8 +231,8 @@ const DateTimeOptions = ({
return (
<>
<select
onBlur={(e) => setDepartArrive(e.target.value)}
onChange={(e) => setDepartArrive(e.target.value)}
onBlur={(e) => setDepartArrive(e.target.value as DepartArriveValue)}
onChange={(e) => setDepartArrive(e.target.value as DepartArriveValue)}
onKeyDown={onKeyDown}
value={departArrive}
>
Expand Down

0 comments on commit ac2e274

Please sign in to comment.