How I can make a restriction for date selection such as just show date 1 & 15 only for every month when select date in datepicker for ionic app? Please check out my script below:
template html
<ion-view title="Template">
<ion-nav-buttons side="secondary">
<button class="button-icon icon ion-calendar assertive" ng-click="datePicker()"> </button>
</ion-nav-buttons>
<div class="bar bar-subheader bar-assertive">
</div>
<ion-content class="has-header has-subheader ">
<p>{{currentDate}}</p>
</ion-content>
</ion-view>
</body>
</html>
Controller js
.controller('MyCtrl', function($scope, $rootScope, $ionicPopup, $state, $filter) {
$scope.datePicker =function() {
$ionicPopup.prompt({
title: 'Date Picker',
template: 'Please Input Date',
inputType: 'date',
}).then(function(res) {
if (res) {
$scope.currentDate = res;
var newdate = $filter('date')($scope.currentDate,'yyyy/MM/dd');
$rootScope.showLoading("Loading data..");
} else {
console.log('nothing');
}
});
}
});
I hope anyone can help me to solve this problem