Skip to content

Commit

Permalink
add maximum date
Browse files Browse the repository at this point in the history
  • Loading branch information
muzanella11 committed Sep 4, 2024
1 parent b6badca commit 2e154bb
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion hosting/src/components/TogglePublishDocument.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ export function TogglePublishDocument() {
const {documentId} = useParams<{documentId: string}>() ?? {};
const {data: document, changeStatus} = useTanamDocument(documentId);

const maxDate = new Date();
maxDate.setDate(maxDate.getDate() + 30);

const [isLoading, setIsLoading] = useState(false);
const [isDialogOpen, setIsDialogOpen] = useState(false);
const [isDropdownPublishOpen, setIsDropdownPublishOpen] = useState(false);
Expand Down Expand Up @@ -152,10 +155,11 @@ export function TogglePublishDocument() {
disabled={isLoading}
enableTime={true}
label="Published At"
placeholder="Y-m-d H:i"
placeholder="Select date and time"
dateFormat="Y-m-d H:i"
minDate="today"
defaultValue={publishedAt}
maxDate={maxDate}
onChange={setPublishedAt}
/>
</Modal>
Expand Down

0 comments on commit 2e154bb

Please sign in to comment.