fix: removed today's date from closeOnDate date picker

This commit is contained in:
Piyush Gupta
2023-07-19 00:11:01 +05:30
parent 6e8be0c0bd
commit b20cda2d06
+2 -1
View File
@@ -8,6 +8,7 @@ import Button from "./Button";
import { Calendar } from "./Calendar";
import { useRef } from "react";
import { SelectSingleEventHandler } from "react-day-picker";
import { addDays } from "date-fns";
export function DatePicker({
date,
@@ -44,7 +45,7 @@ export function DatePicker({
mode="single"
selected={formattedDate}
disabled={{
before: new Date(),
before: addDays(new Date(), 1),
}}
onSelect={handleDateSelect}
initialFocus