|
1 | | -import { DialogContent } from "@mui/material"; |
2 | | -import { useEffect, useMemo } from "react"; |
3 | | -import * as yup from "yup"; |
4 | | -import { FormProvider, useForm } from "react-hook-form"; |
5 | | -import { yupResolver } from "@hookform/resolvers/yup"; |
6 | | -import ModalTitleBar from "@/components/Shared/Modals/ModalTitleBar"; |
7 | | -import ModalActions from "@/components/Shared/Modals/ModalActions"; |
8 | | -import dayjs, { Dayjs } from "dayjs"; |
9 | | -import { |
10 | | - ContinuationReport, |
11 | | - ContinuationReportAPIData, |
12 | | - ContinuationReportFormData, |
13 | | -} from "@/models/ContinuationReport"; |
14 | | -import ControlledRichTextEditor from "@/components/Shared/Controlled/ControlledRichTextEditor"; |
15 | 1 | import ControlledDateTimeField from "@/components/Shared/Controlled/ControlledDateTimeField"; |
| 2 | +import ControlledRichTextEditor from "@/components/Shared/Controlled/ControlledRichTextEditor"; |
| 3 | +import ModalActions from "@/components/Shared/Modals/ModalActions"; |
| 4 | +import ModalTitleBar from "@/components/Shared/Modals/ModalTitleBar"; |
16 | 5 | import { |
17 | 6 | useCreateContinuationReportEntry, |
18 | 7 | useDeleteContinuationReportEntry, |
19 | 8 | useUpdateContinuationReportEntry, |
20 | 9 | } from "@/hooks/useContinuationReports"; |
| 10 | +import { |
| 11 | + ContinuationReport, |
| 12 | + ContinuationReportAPIData, |
| 13 | + ContinuationReportFormData, |
| 14 | +} from "@/models/ContinuationReport"; |
21 | 15 | import dateUtils from "@/utils/dateUtils"; |
| 16 | +import { yupResolver } from "@hookform/resolvers/yup"; |
| 17 | +import { DialogContent } from "@mui/material"; |
| 18 | +import dayjs, { Dayjs } from "dayjs"; |
| 19 | +import { useEffect, useMemo } from "react"; |
| 20 | +import { FormProvider, useForm } from "react-hook-form"; |
| 21 | +import * as yup from "yup"; |
22 | 22 | import { ContinuationReportContextType } from "./ContinuationReport"; |
23 | 23 |
|
24 | 24 | type ContinuationReportEntryModal = { |
@@ -74,7 +74,7 @@ const ContinuationReportEntryModal: React.FC<ContinuationReportEntryModal> = ({ |
74 | 74 | mode: "onBlur", |
75 | 75 | defaultValues, |
76 | 76 | }); |
77 | | - |
| 77 | + const maxSelectableDate = dayjs().add(1, "day"); |
78 | 78 | const { handleSubmit, reset } = methods; |
79 | 79 |
|
80 | 80 | useEffect(() => { |
@@ -132,6 +132,7 @@ const ContinuationReportEntryModal: React.FC<ContinuationReportEntryModal> = ({ |
132 | 132 | name="dateOfEntry" |
133 | 133 | label="Date and Time" |
134 | 134 | sx={{ width: "50%" }} |
| 135 | + maxDateTime={maxSelectableDate} |
135 | 136 | /> |
136 | 137 | <ControlledRichTextEditor label="Entry" name="entry" /> |
137 | 138 | </DialogContent> |
|
0 commit comments