diff --git a/app/[leaflet_id]/publish/PublishPost.tsx b/app/[leaflet_id]/publish/PublishPost.tsx index 7aa301fe..8b0aa3cf 100644 --- a/app/[leaflet_id]/publish/PublishPost.tsx +++ b/app/[leaflet_id]/publish/PublishPost.tsx @@ -251,8 +251,8 @@ const BackdateOptions = (props: { ); const [timeValue, setTimeValue] = useState(() => { - if (!props.publishedAt) return "12:00"; - return `${props.publishedAt.getHours().toString().padStart(2, "0")}:${props.publishedAt.getMinutes().toString().padStart(2, "0")}`; + const date = props.publishedAt || new Date(); + return `${date.getHours().toString().padStart(2, "0")}:${date.getMinutes().toString().padStart(2, "0")}`; }); let currentTime = `${new Date().getHours().toString().padStart(2, "0")}:${new Date().getMinutes().toString().padStart(2, "0")}`; diff --git a/components/DatePicker.tsx b/components/DatePicker.tsx index 1967e390..fa401622 100644 --- a/components/DatePicker.tsx +++ b/components/DatePicker.tsx @@ -44,6 +44,7 @@ export const DatePicker = ({ }} mode="single" selected={selected} + defaultMonth={selected} onSelect={onSelect} disabled={disabled} />