From afed8fc90fe6815f6cb023a606e2f84984f70f3d Mon Sep 17 00:00:00 2001 From: michaelschal <35957947-michaelschal@users.noreply.replit.com> Date: Thu, 9 Oct 2025 09:03:34 +0000 Subject: [PATCH] Improve calendar view to display more scheduled posts Update calendar view to use a popover for showing additional scheduled posts when multiple posts are scheduled for the same day, and refine date comparison logic to prevent timezone issues. Replit-Commit-Author: Agent Replit-Commit-Session-Id: ae4037a0-2a6f-4530-9bac-79b543286bda Replit-Commit-Checkpoint-Type: intermediate_checkpoint Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/397bca8c-984f-43ff-841a-10897aeb8140/ae4037a0-2a6f-4530-9bac-79b543286bda/WWV0v7F --- client/src/components/calendar-view.tsx | 80 +++++++++++++++++++++++-- 1 file changed, 75 insertions(+), 5 deletions(-) diff --git a/client/src/components/calendar-view.tsx b/client/src/components/calendar-view.tsx index 1292da5..5a1c5fb 100644 --- a/client/src/components/calendar-view.tsx +++ b/client/src/components/calendar-view.tsx @@ -1,6 +1,7 @@ import { useState } from "react"; import { Button } from "@/components/ui/button"; -import { ChevronLeft, ChevronRight, Calendar as CalendarIcon, Trash2, Edit } from "lucide-react"; +import { Popover, PopoverContent, PopoverTrigger } from "@/components/ui/popover"; +import { ChevronLeft, ChevronRight, Calendar as CalendarIcon, Trash2, Edit, MoreHorizontal } from "lucide-react"; import { useQuery, useMutation } from "@tanstack/react-query"; import { useToast } from "@/hooks/use-toast"; import { apiRequest, queryClient } from "@/lib/queryClient"; @@ -57,7 +58,11 @@ export default function CalendarView() { return (scheduledPosts || []).filter(post => { if (!post.scheduledAt) return false; const postDate = new Date(post.scheduledAt); - return postDate.toDateString() === date.toDateString(); + + // Compare using local date components to avoid timezone issues + return postDate.getFullYear() === date.getFullYear() && + postDate.getMonth() === date.getMonth() && + postDate.getDate() === date.getDate(); }); }; @@ -246,9 +251,74 @@ export default function CalendarView() { ); })} {postsForDay.length > 2 && ( -