修复heropanel无法下拉背景页面
This commit is contained in:
@@ -81,6 +81,7 @@ const getConceptColor = (concept: string) => {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 将连续相同概念的日期合并成跨天事件
|
* 将连续相同概念的日期合并成跨天事件
|
||||||
|
* 注意:在周六截断,避免跨周显示导致布局问题
|
||||||
*/
|
*/
|
||||||
const mergeConsecutiveConcepts = (data: CalendarEventData[]): EventInput[] => {
|
const mergeConsecutiveConcepts = (data: CalendarEventData[]): EventInput[] => {
|
||||||
if (!data.length) return [];
|
if (!data.length) return [];
|
||||||
@@ -103,7 +104,11 @@ const mergeConsecutiveConcepts = (data: CalendarEventData[]): EventInput[] => {
|
|||||||
concept === prevItem.topSector &&
|
concept === prevItem.topSector &&
|
||||||
isNextDay(prevItem.date, dateStr);
|
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.endDate = dateStr;
|
||||||
currentEvent.dates.push(dateStr);
|
currentEvent.dates.push(dateStr);
|
||||||
|
|||||||
Reference in New Issue
Block a user