Skip to content

Commit 484f28a

Browse files
committed
fix(book): disable days before present day
1 parent f620dea commit 484f28a

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

pages/dropzone/[id]/index.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ import { errorNotification } from 'helpers/notification';
2525
import Loader from 'components/Loader';
2626
import Head from 'next/head';
2727

28+
const now = new Date();
29+
2830
const DropzoneDetails: NextPage<Props> = ({ details, location }) => {
2931
const Router = useRouter();
3032
const { query } = Router;
@@ -251,7 +253,7 @@ const DropzoneDetails: NextPage<Props> = ({ details, location }) => {
251253
format="LL"
252254
dayPickerProps={{
253255
selectedDays: [from, { from, to }],
254-
disabledDays: { after: to },
256+
disabledDays: { before: now, after: to },
255257
toMonth: to,
256258
modifiers: { start: from, end: to },
257259
numberOfMonths: 2,

0 commit comments

Comments
 (0)