Skip to content

Commit

Permalink
fix(datetimepickerv2withtimespinner): added null undefined check (#3845)
Browse files Browse the repository at this point in the history
  • Loading branch information
abpaul1993 authored Feb 27, 2024
1 parent 74abb5b commit 038c828
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1042,7 +1042,7 @@ const DateTimePicker = ({
[`${iotPrefix}--date-time-picker__disabled`]:
disabled ||
(isSingleSelect &&
(!singleDateValue.startDate || (hasTimeInput ? !singleTimeValue : false))),
(!singleDateValue?.startDate || (hasTimeInput ? !singleTimeValue : false))), // singleDateValue might be null or undefined
})}
title={humanValue}
>
Expand Down Expand Up @@ -1314,7 +1314,7 @@ const DateTimePicker = ({
absoluteValue && datePickerType === 'range'
? [absoluteValue.startDate, absoluteValue.endDate]
: singleDateValue && datePickerType === 'single'
? [singleDateValue.startDate]
? [singleDateValue?.startDate]
: null
}
locale={locale}
Expand Down

0 comments on commit 038c828

Please sign in to comment.