Skip to content

Commit 47b0985

Browse files
committed
updated function for today block
1 parent 066f06f commit 47b0985

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Shared/Components/DatePicker/DateTimePicker.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ const DateTimePicker = ({
6868

6969
const today = moment()
7070
// Function to disable dates including today and all past dates
71-
const isDayBlocked = (day) => !day.isAfter(today)
71+
const isDayBlocked = (day) => isTodayBlocked && !day.isAfter(today)
7272

7373
return (
7474
<div>
@@ -94,7 +94,7 @@ const DateTimePicker = ({
9494
inputIconPosition="after"
9595
displayFormat={DATE_TIME_FORMATS.DD_MMM_YYYY}
9696
data-testid={dataTestidForDate}
97-
isDayBlocked={isTodayBlocked ? isDayBlocked : undefined}
97+
isDayBlocked={isDayBlocked}
9898
/>
9999
{!hideTimeSelect && (
100100
<div className="dc__no-shrink">

0 commit comments

Comments
 (0)