|
@@ -75,19 +75,6 @@ export function bannersForWeek(week, spans) {
|
|
|
const weekEnd = week[6];
|
|
const weekEnd = week[6];
|
|
|
const banners = [];
|
|
const banners = [];
|
|
|
|
|
|
|
|
- // A 1-column clipped banner (only the last column of the week is visible) should be
|
|
|
|
|
- // suppressed when another banner already covers that column, because there is not enough
|
|
|
|
|
- // space for a legible gap. It reappears as a carry-over in the following week row.
|
|
|
|
|
- // Two overlap scenarios trigger suppression:
|
|
|
|
|
- // (a) an earlier-starting clipped banner already extends to the same last column
|
|
|
|
|
- // (b) a non-clipped banner ends on the same day (gap collapses to ~4px)
|
|
|
|
|
- const endsInWeek = new Set(
|
|
|
|
|
- spans.filter(s => s.end >= weekStart && s.end <= weekEnd).map(s => +s.end)
|
|
|
|
|
- );
|
|
|
|
|
- const clippedStartTimes = spans
|
|
|
|
|
- .filter(s => s.start >= weekStart && s.start <= weekEnd && s.end > weekEnd)
|
|
|
|
|
- .map(s => +s.start);
|
|
|
|
|
-
|
|
|
|
|
for (const span of spans) {
|
|
for (const span of spans) {
|
|
|
if (span.end < weekStart || span.start > weekEnd) continue;
|
|
if (span.end < weekStart || span.start > weekEnd) continue;
|
|
|
|
|
|
|
@@ -99,12 +86,6 @@ export function bannersForWeek(week, spans) {
|
|
|
const leftInset = span.start >= weekStart ? 0.2 : 0;
|
|
const leftInset = span.start >= weekStart ? 0.2 : 0;
|
|
|
const rightBleed = span.end <= weekEnd ? 0.8 : 0;
|
|
const rightBleed = span.end <= weekEnd ? 0.8 : 0;
|
|
|
|
|
|
|
|
- if (rightBleed === 0 && spanCols === 1 && span.start >= weekStart) {
|
|
|
|
|
- const precedingClipped = clippedStartTimes.some(t => t < +span.start);
|
|
|
|
|
- const sameDayNonClipped = endsInWeek.has(+clipStart);
|
|
|
|
|
- if (precedingClipped || sameDayNonClipped) continue;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
const leftPct = ((startCol + leftInset) / 7) * 100;
|
|
const leftPct = ((startCol + leftInset) / 7) * 100;
|
|
|
const widthPct = ((spanCols - leftInset - rightBleed) / 7) * 100;
|
|
const widthPct = ((spanCols - leftInset - rightBleed) / 7) * 100;
|
|
|
|
|
|