DatePicker triggered once

Hello,

I know that this issue dosen’t come from Ionic but maybe than you can help me.
A tried to use this datepicker plugin : https://github.com/Sharinglabs/cordova-plugin-datepicker

I have an issue with the following code :

View side :

<button ng-click="pluginHour()">{{alert.hour}}</button>

Controller side :

$scope.pluginHour = function() {
datePicker.show(optionsDP, function(date){
$scope.alert.hour=date.getHours()+"h"+date.getMinutes();
});
}

var optionsDP = {
date: new Date(),
mode: 'time'
};

It’s working on IOS and android but only once. When I click again on the button nothing happens.

Any idea?


$scope.pluginHour = function() {
var optionsDP = {
date: new Date(),
mode: ‘time’
};
datePicker.show(optionsDP, function(date){
$scope.alert.hour=date.getHours()+“h”+date.getMinutes();
});
}


1 Like