修复heropanel无法下拉背景页面

This commit is contained in:
2026-01-14 17:24:35 +08:00
parent 167ee0cce7
commit 1c81448bb3

View File

@@ -81,6 +81,7 @@ const getConceptColor = (concept: string) => {
/**
* 将连续相同概念的日期合并成跨天事件
* 注意:在周六截断,避免跨周显示导致布局问题
*/
const mergeConsecutiveConcepts = (data: CalendarEventData[]): EventInput[] => {
if (!data.length) return [];
@@ -103,7 +104,11 @@ const mergeConsecutiveConcepts = (data: CalendarEventData[]): EventInput[] => {
concept === prevItem.topSector &&
isNextDay(prevItem.date, dateStr);
if (isConsecutive && currentEvent) {
// 检查前一天是否是周六day() === 6如果是则需要截断开始新事件
const prevDate = prevItem ? dayjs(prevItem.date, 'YYYYMMDD') : null;
const shouldBreakAtWeekend = prevDate && prevDate.day() === 6; // 周六
if (isConsecutive && currentEvent && !shouldBreakAtWeekend) {
// 延续当前事件
currentEvent.endDate = dateStr;
currentEvent.dates.push(dateStr);