Angular Datepicker - Prev and Next

2

I'm using the following calendar in my project:

link

I need to customize the back and forth buttons of the calendar, I disabled these buttons from the default calendar (I searched the class and gave a display none), but I need to use them in another part of the project, someone has some function that I can to use through some div? For example:

 $('.voltar_calendario').click(function() {
            $('.datepicker').pickadate('prev');
        });
        $('.avancar_calendario').click(function() {
            $('.datepicker').pickadate('next');
        });

Note: this does not work, for example;

I need the current date that is displayed at the top of the calendar as well.

The only html to activate the calendar is as follows:

<uib-datepicker ng-model="dt" class="well-sm no_right" datepicker-options="inlineOptions" style="float:left; width: 100%;"></uib-datepicker>

Here's a picture of why I had to hide the calendar header with css, as I need to use the title:

Linkthesamecalendartotheplunker: link

    
asked by anonymous 15.04.2016 / 18:53

2 answers

2

Try to use the jquery click event without specifying the ng-controller and div.

For example:

$ ('. uib-left'). click ();

    
19.04.2016 / 21:25
1

You can via jQuery force a click on the next and prev buttons inside the controller.

$('#mydt-uib-left').click(function() {
	$('div[ng-controller="DatepickerCtrl"] .uib-left').click();
});

$('#mydt-uib-right').click(function() {
	$('div[ng-controller="DatepickerCtrl"] .uib-right').click();
});
<button type="button" id="mydt-uib-left"> <- </button>
<button type="button" id="mydt-uib-right"> -> </button>
    
19.04.2016 / 20:32