Adds workweek settings and dynamic view configuration
Introduces settings service for managing tenant-specific calendar configurations Enables dynamic workweek presets with configurable work days Improves view switching with enhanced UI components Adds flexible calendar rendering based on tenant settings Extends DateService to support workweek date generation
This commit is contained in:
parent
58cedb9fad
commit
ad2df353b5
13 changed files with 751 additions and 38 deletions
|
|
@ -48,6 +48,21 @@ export class DateService {
|
|||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get dates for specific weekdays within a week
|
||||
* @param offset - Week offset from base date (0 = current week)
|
||||
* @param workDays - Array of ISO weekday numbers (1=Monday, 7=Sunday)
|
||||
* @returns Array of date strings in YYYY-MM-DD format
|
||||
*/
|
||||
getWorkWeekDates(offset: number, workDays: number[]): string[] {
|
||||
const monday = this.baseDate.startOf('week').add(1, 'day').add(offset, 'week');
|
||||
return workDays.map(isoDay => {
|
||||
// ISO: 1=Monday, 7=Sunday → days from Monday: 0-6
|
||||
const daysFromMonday = isoDay === 7 ? 6 : isoDay - 1;
|
||||
return monday.add(daysFromMonday, 'day').format('YYYY-MM-DD');
|
||||
});
|
||||
}
|
||||
|
||||
// ============================================
|
||||
// FORMATTING
|
||||
// ============================================
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue