Skip to content

Commit f27592a

Browse files
committed
chore: bump version to 1.20.6-pre-53 and update DateTimePicker logic
1 parent d21b708 commit f27592a

3 files changed

Lines changed: 7 additions & 5 deletions

File tree

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@devtron-labs/devtron-fe-common-lib",
3-
"version": "1.20.6-pre-51",
3+
"version": "1.20.6-pre-53",
44
"description": "Supporting common component library",
55
"type": "module",
66
"main": "dist/index.js",

src/Shared/Components/DatePicker/DateTimePicker.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ const DateTimePicker = ({
6767
isOutsideRange,
6868
rangeShortcutOptions,
6969
}: DateTimePickerProps) => {
70-
const today = getTodayDate()
7170
const calendarPopoverId = useRef<string>(getUniqueId())
7271

7372
const { open, overlayProps, popoverProps, triggerProps, scrollableRef } = usePopover({
@@ -137,10 +136,13 @@ const DateTimePicker = ({
137136
return true
138137
}
139138

139+
const today = getTodayDate()
140+
today.setHours(0, 0, 0, 0)
141+
140142
const isOutsideRangeFn = isOutsideRange || (() => false)
141143

142144
if (isTodayBlocked) {
143-
return (date: Date) => date <= today
145+
return (date: Date) => date <= today || isOutsideRangeFn(date)
144146
}
145147

146148
if (blockPreviousDates) {

0 commit comments

Comments
 (0)