user233428
user233428

Reputation: 177

Button in bootstrap datepicker

I use AngularJS and HTML. Tell me how the calendar to change the function of buttons that when pressed, it was caused by my function. Now when you press the "OK" button, the data is received. I tried to listen to the event

$scope.$on('hideCalendar.daterangepicker', function () {
 openDatePicker();
});

Connected daterangepicker

<input id="date" date-range-picker class="form-control date-picker"
style="width: 200px;"
ng-model="datePicker.date_range"/>

enter image description here

Upvotes: 1

Views: 595

Answers (1)

Ollie Smith
Ollie Smith

Reputation: 436

I'm not entirely certain what you are asking but this may help.

Here I am using AngularJs and Angular Material Date Picker:

DatePicker:

 <md-datepicker date-format="yyyy-MM-dd" ng-model="myDate" md-placeholder="Select date"></md-datepicker>

Ok button:

<md-button class="md-raised" ng-click="createfolder()">Ok</md-button>

AngularJs (I am getting the year and month from the datepicker):

  $scope.createfolder = function () { if ($scope.myDate) {
        var year = $scope.myDate.getFullYear();
        var month = ($scope.myDate.getMonth()) + 1; } };

Upvotes: 2

Related Questions