Skip to content

Commit

Permalink
datesDidUpdate
Browse files Browse the repository at this point in the history
  • Loading branch information
arshaw committed Apr 10, 2020
1 parent 80275dd commit 412ad48
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
2 changes: 2 additions & 0 deletions examples/timegrid-views.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@
// dayCellContent: function(arg) { console.log('dayCellContent', arg) },
// dayCellClassNames: function(arg) { console.log('dayCellClassNames', arg) },

// datesDidUpdate: function() { console.log('datesDidUpdate') },

// nowIndicator: true,
defaultDate: '2020-02-12',
defaultView: 'timeGridWeek',
Expand Down
9 changes: 9 additions & 0 deletions packages/core/src/CalendarComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,15 @@ export default class CalendarComponent extends BaseComponent<CalendarComponentPr
componentDidMount() {
window.addEventListener('beforeprint', this.handleBeforePrint)
window.addEventListener('afterprint', this.handleAfterPrint)

this.context.calendar.publiclyTrigger('datesDidUpdate')
}


componentDidUpdate(prevProps: CalendarComponentProps) {
if (prevProps.dateProfile !== this.props.dateProfile) {
this.context.calendar.publiclyTrigger('datesDidUpdate')
}
}


Expand Down

0 comments on commit 412ad48

Please sign in to comment.