Adds date-based column retrieval
Adds a method to retrieve column bounds based on a given date, enhancing date-specific event placement. Removes unnecessary data storage for overflow event titles, simplifying overflow event handling.
This commit is contained in:
parent
67dfb6e894
commit
6a17bba343
2 changed files with 18 additions and 8 deletions
|
|
@ -551,11 +551,7 @@ export class AllDayManager {
|
|||
const gridRow = parseInt(event.style.gridRow) || 1;
|
||||
|
||||
if (gridRow === 4) {
|
||||
// Store original content before converting to indicator
|
||||
if (!event.dataset.originalTitle) {
|
||||
event.dataset.originalTitle = event.dataset.title || event.innerHTML;
|
||||
}
|
||||
|
||||
|
||||
// Convert row 4 events to indicators
|
||||
const overflowCount = this.actualRowCount - 3; // Total overflow rows
|
||||
event.classList.add('max-event-overflow');
|
||||
|
|
@ -586,9 +582,7 @@ export class AllDayManager {
|
|||
// Restore original title from data-title
|
||||
if (htmlEvent.dataset.title) {
|
||||
htmlEvent.innerHTML = htmlEvent.dataset.title;
|
||||
} else if (htmlEvent.dataset.originalTitle) {
|
||||
htmlEvent.innerHTML = htmlEvent.dataset.originalTitle;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// Show all hidden events
|
||||
|
|
|
|||
|
|
@ -67,6 +67,22 @@ export class ColumnDetectionUtils {
|
|||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get column bounds by Date
|
||||
*/
|
||||
public static getColumnBoundsByDate(date: Date): ColumnBounds | null {
|
||||
if (this.columnBoundsCache.length === 0) {
|
||||
this.updateColumnBoundsCache();
|
||||
}
|
||||
|
||||
// Convert Date to YYYY-MM-DD format
|
||||
var dateString = date.toISOString().split('T')[0];
|
||||
|
||||
// Find column that matches the date
|
||||
var column = this.columnBoundsCache.find(col => col.date === dateString);
|
||||
return column || null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Clear cache (useful for testing or when DOM structure changes)
|
||||
*/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue