@@ -107,12 +107,6 @@ export class CalendarMonthViewComponent implements OnChanges, OnInit, OnDestroy
107
107
*/
108
108
@Input ( ) activeDayIsOpen : boolean = false ;
109
109
110
- /**
111
- * A function that will be called before each cell is rendered. The first argument will contain the calendar cell.
112
- * If you add the `cssClass` property to the cell it will add that class to the cell in the template
113
- */
114
- @Input ( ) dayModifier : Function ;
115
-
116
110
/**
117
111
* An observable that when emitted on will re-render the current view
118
112
*/
@@ -158,6 +152,12 @@ export class CalendarMonthViewComponent implements OnChanges, OnInit, OnDestroy
158
152
*/
159
153
@Input ( ) weekendDays : number [ ] ;
160
154
155
+ /**
156
+ * An output that will be called before the view is rendered for the current month.
157
+ * If you add the `cssClass` property to a day in the body it will add that class to the cell element in the template
158
+ */
159
+ @Output ( ) beforeViewRender : EventEmitter < { header : WeekDay [ ] , body : MonthViewDay [ ] } > = new EventEmitter ( ) ;
160
+
161
161
/**
162
162
* Called when the day cell is clicked
163
163
*/
@@ -280,6 +280,7 @@ export class CalendarMonthViewComponent implements OnChanges, OnInit, OnDestroy
280
280
excluded : this . excludeDays ,
281
281
weekendDays : this . weekendDays
282
282
} ) ;
283
+ this . emitBeforeViewRender ( ) ;
283
284
}
284
285
285
286
private refreshBody ( ) : void {
@@ -290,9 +291,7 @@ export class CalendarMonthViewComponent implements OnChanges, OnInit, OnDestroy
290
291
excluded : this . excludeDays ,
291
292
weekendDays : this . weekendDays
292
293
} ) ;
293
- if ( this . dayModifier ) {
294
- this . view . days . forEach ( day => this . dayModifier ( day ) ) ;
295
- }
294
+ this . emitBeforeViewRender ( ) ;
296
295
}
297
296
298
297
private checkActiveDayIsOpen ( ) : void {
@@ -312,4 +311,13 @@ export class CalendarMonthViewComponent implements OnChanges, OnInit, OnDestroy
312
311
this . checkActiveDayIsOpen ( ) ;
313
312
}
314
313
314
+ private emitBeforeViewRender ( ) : void {
315
+ if ( this . columnHeaders && this . view ) {
316
+ this . beforeViewRender . emit ( {
317
+ header : this . columnHeaders ,
318
+ body : this . view . days
319
+ } ) ;
320
+ }
321
+ }
322
+
315
323
}
0 commit comments