diff --git a/client/src/components/calendar-list-view.tsx b/client/src/components/calendar-list-view.tsx index b8e8577..9cb2fad 100644 --- a/client/src/components/calendar-list-view.tsx +++ b/client/src/components/calendar-list-view.tsx @@ -88,18 +88,37 @@ export default function CalendarListView({ scheduledPosts, onEditPost, onDeleteP Aucune publication programmée ) : ( - sortedDates.map((dateStr) => { + sortedDates.map((dateStr, index) => { const posts = groupedPosts[dateStr]; const isExpanded = expandedDates.has(dateStr); const dateObj = parseISO(dateStr); const isDateToday = isToday(dateStr); + + // Check if we need to show the separator (first past date) + const isPastDate = dateStr < today; + const prevDate = index > 0 ? sortedDates[index - 1] : null; + const prevWasFutureOrToday = prevDate ? (prevDate >= today) : false; + const showSeparator = isPastDate && prevWasFutureOrToday; return ( -
+
+ {showSeparator && ( +
+
+ + Publications passées + +
+
+ )} +
)}
+
); }) )}