I use AngularJS and HTML. Tell me how to change the function of the button in the calendar so that when I clicked on it, my function would be called. Now when you press the "OK" button, the date is accepted. I tried to listen to the event

$('.date-picker').on('apply.daterangepicker', function(ev, picker) { openDatePicker(); }); 

Connected daterangepicker

 <input date-range-picker class="form-control date-picker" style="width: 200px;" ng-model="datePicker.date_range"/> $scope.openDatePicker = function () { console.log('open') }; 

enter image description here

  • can all code be? write angular, and the jquery code is L. Vadim
  • I connected the bootstrap daterangepicker directive, there is essentially no code, I think that the directive itself cannot be corrected - user233428
  • did you find in the library source where the default behavior of clicking this button is called? -
  • Yes, clickApply: function (e) {this.hide (); this.element.trigger ('apply.daterangepicker', this); } - user233428
  • I'm now stoned with stones, but when I needed to change the behavior, I corrected the source daterangepicker and for 1.5 years everything has been working fine in the project :) -

1 answer 1

 $('.date-picker').on('apply.daterangepicker', function(ev, picker) { $scope.openDatePicker(); });