Skip to content

Commit

Permalink
fix(CCalendar, CDatePicker, CDateRangePick
Browse files Browse the repository at this point in the history
er): calendar panels are removed when you click the year or month
  • Loading branch information
mrholek committed Aug 2, 2023
1 parent a03cf57 commit c87ce56
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions js/src/calendar.js
Original file line number Diff line number Diff line change
Expand Up @@ -201,15 +201,13 @@ class Calendar extends BaseComponent {
EventHandler.on(this._element, 'click', '.btn-month', event => {
event.preventDefault()
this._view = 'months'
this._element.innerHTML = ''
this._createCalendarPanel()
this._updateCalendar()
})

EventHandler.on(this._element, 'click', '.btn-year', event => {
event.preventDefault()
this._view = 'years'
this._element.innerHTML = ''
this._createCalendarPanel()
this._updateCalendar()
})
}

Expand Down Expand Up @@ -403,7 +401,7 @@ class Calendar extends BaseComponent {

_updateCalendar() {
this._element.innerHTML = ''
this._createCalendarPanel()
this._createCalendar()
}

_dayClassNames(date, month) {
Expand Down

0 comments on commit c87ce56

Please sign in to comment.