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 ff9ce9e
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 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 @@ -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 ff9ce9e

Please sign in to comment.