File tree Expand file tree Collapse file tree 2 files changed +12
-11
lines changed
Expand file tree Collapse file tree 2 files changed +12
-11
lines changed Original file line number Diff line number Diff line change @@ -29,7 +29,6 @@ const EVENT_LOAD_DATA_API = `load${EVENT_KEY}${DATA_API_KEY}`
2929
3030const CLASS_NAME_SHOW = 'show'
3131
32- const SELECTOR_CALENDAR = '.calendar'
3332const SELECTOR_DATA_TOGGLE = '[data-coreui-toggle="date-picker"]:not(.disabled):not(:disabled)'
3433const SELECTOR_DATA_TOGGLE_SHOWN = `${ SELECTOR_DATA_TOGGLE } .${ CLASS_NAME_SHOW } `
3534
@@ -65,20 +64,14 @@ class DatePicker extends DateRangePicker {
6564 }
6665
6766 // Overrides
68- _addCalendarEventListeners ( ) {
69- super . _addCalendarEventListeners ( )
70- for ( const calendar of SelectorEngine . find ( SELECTOR_CALENDAR , this . _element ) ) {
71- EventHandler . on ( calendar , 'startDateChange.coreui.calendar' , event => {
72- this . _startDate = event . date
73- this . _startInput . value = this . _setInputValue ( event . date )
74- this . _selectEndDate = false
75- this . _calendar . update ( this . _getCalendarConfig ( ) )
67+ _addEventListeners ( ) {
68+ super . _addEventListeners ( )
7669
70+ EventHandler . on ( this . _element , 'startDateChange.coreui.date-range-picker' , event => {
7771 EventHandler . trigger ( this . _element , EVENT_DATE_CHANGE , {
7872 date : event . date
7973 } )
80- } )
81- }
74+ } )
8275 }
8376
8477 // Static
Original file line number Diff line number Diff line change @@ -323,6 +323,10 @@ class DateRangePicker extends BaseComponent {
323323 this . _startDate = date
324324 this . _calendarDate = date
325325 this . _calendar . update ( this . _getCalendarConfig ( ) )
326+
327+ EventHandler . trigger ( this . _element , EVENT_START_DATE_CHANGE , {
328+ date : date
329+ } )
326330 }
327331 } )
328332
@@ -361,6 +365,10 @@ class DateRangePicker extends BaseComponent {
361365 this . _endDate = date
362366 this . _calendarDate = date
363367 this . _calendar . update ( this . _getCalendarConfig ( ) )
368+
369+ EventHandler . trigger ( this . _element , EVENT_END_DATE_CHANGE , {
370+ date : value
371+ } )
364372 }
365373 } )
366374
You can’t perform that action at this time.
0 commit comments