From f0d30124d82f0a3a344fffaf9819232db9619830 Mon Sep 17 00:00:00 2001 From: celine Date: Fri, 16 Jan 2026 19:09:39 -0500 Subject: [PATCH] open calendars to corrent months and times by default --- app/[leaflet_id]/publish/PublishPost.tsx | 4 ++-- components/DatePicker.tsx | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) 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} /> -- 2.51.2