Reputation: 142
I want to use the Date Paginator Bootstrap and take the particular date i click.
I triede to use it as belows, but from this im getting the alert even if click on a arrow.
<!--BEGIN LOADING CSS FOR PAGE-->
<link type="text/css" rel="stylesheet" href="assets/vendors/bootstrap-datepaginator/bootstrap-datepaginator.min.css">
<link type="text/css" rel="stylesheet" href="assets/vendors/bootstrap-datepaginator/datepicker.css">
<!--END LOADING CSS FOR PAGE-->
<!--BEGIN HTML-->
<div class="paginator paginator-select paginator-success"></div>
<!--END HTML-->
<!--BEGIN LOADING SCRIPTS FOR PAGE-->
<script src="assets/vendors/bootstrap-datepaginator/moment.js"></script>
<script src="assets/vendors/bootstrap-datepaginator/bootstrap-datepaginator.min.js"></script>
<script src="assets/vendors/bootstrap-datepaginator/bootstrap-datepicker.js"></script>
<!--END LOADING SCRIPTS FOR PAGE-->
<!--BEGIN JAVASCRIPT-->
<script>
$('.paginator-select').datepaginator({
onSelectedDateChanged: function (event, date) {
alert("Selected date: " + moment(date).format("Do, MMM YYYY"));
}
});
</script>
<!--END JAVASCRIPT-->
What can i do to fix this.
Upvotes: 0
Views: 1612
Reputation: 630
As per Git repository for bootstrap-datepaginator there is no such method to retrieve date but you can write value in some global variable in the event you have handled and use it later, I did same :)
Only one care you need to take that on pageload initialize your variable with initial date of paginator.
Upvotes: 1