Skip to content

Commit 0b2adee

Browse files
committed
makin' my way downtown, walkin' fast, faces pass and I'm fixin' type errors
1 parent 96a5439 commit 0b2adee

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

app/ui/lib/DateRangePicker.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ export function DateRangePicker(props: DateRangePickerProps) {
4444
// because we always pass a value to this component and there is no way to
4545
// unset the value through the UI.
4646
if (!state.dateRange) return 'No range selected'
47+
if (!state.dateRange.end) return 'No end date selected'
48+
if (!state.dateRange.start) return 'No start date selected'
4749

4850
return formatter.formatRange(
4951
state.dateRange.start.toDate(getLocalTimeZone()),
@@ -94,15 +96,15 @@ export function DateRangePicker(props: DateRangePickerProps) {
9496
<TimeField
9597
label="Start time"
9698
value={state.timeRange?.start || null}
97-
onChange={(v: TimeValue) => state.setTime('start', v)}
99+
onChange={(v: TimeValue | null) => state.setTime('start', v)}
98100
hourCycle={24}
99101
className="shrink-0 grow basis-0"
100102
/>
101103
<div className="text-quaternary"></div>
102104
<TimeField
103105
label="End time"
104106
value={state.timeRange?.end || null}
105-
onChange={(v: TimeValue) => state.setTime('end', v)}
107+
onChange={(v: TimeValue | null) => state.setTime('end', v)}
106108
hourCycle={24}
107109
className="shrink-0 grow basis-0"
108110
/>

0 commit comments

Comments
 (0)