Implements FilterTemplate system for event matching
Introduces flexible key-based filtering for calendar events across different view configurations Adds new FilterTemplate class to: - Define event matching rules based on view configuration - Support multi-level grouping (team/resource/date) - Handle dynamic key generation for columns and events Enhances view configuration with explicit id properties and derived fields
This commit is contained in:
parent
c2f7564f8e
commit
dd647acab8
8 changed files with 331 additions and 41 deletions
|
|
@ -11,9 +11,26 @@ dayjs.extend(isoWeek);
|
|||
|
||||
export class DateService {
|
||||
private timezone: string;
|
||||
private baseDate: dayjs.Dayjs;
|
||||
|
||||
constructor(private config: ITimeFormatConfig) {
|
||||
constructor(private config: ITimeFormatConfig, baseDate?: Date) {
|
||||
this.timezone = config.timezone;
|
||||
// Allow setting a fixed base date for demo/testing purposes
|
||||
this.baseDate = baseDate ? dayjs(baseDate) : dayjs();
|
||||
}
|
||||
|
||||
/**
|
||||
* Set a fixed base date (useful for demos with static mock data)
|
||||
*/
|
||||
setBaseDate(date: Date): void {
|
||||
this.baseDate = dayjs(date);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the current base date (either fixed or today)
|
||||
*/
|
||||
getBaseDate(): Date {
|
||||
return this.baseDate.toDate();
|
||||
}
|
||||
|
||||
parseISO(isoString: string): Date {
|
||||
|
|
@ -25,7 +42,7 @@ export class DateService {
|
|||
}
|
||||
|
||||
getWeekDates(offset = 0, days = 7): string[] {
|
||||
const monday = dayjs().startOf('week').add(1, 'day').add(offset, 'week');
|
||||
const monday = this.baseDate.startOf('week').add(1, 'day').add(offset, 'week');
|
||||
return Array.from({ length: days }, (_, i) =>
|
||||
monday.add(i, 'day').format('YYYY-MM-DD')
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue