Closed khashashin closed 5 years ago
Adding a date object solved the problem. The documentation states that date
value in options has new Date()
as default value, but somehow in my case I had to define it. So my final code looks like:
$scope.validFrom = function () {
var options = {
date: new Date(),
mode: 'date', // or 'time'
allowOldDates: false,
};
$cordovaDatePicker.show(options).then(function (date) {
$scope.ticketData.validFrom = DateHelper.formatDateDDMMYYYY(date);
});
};
Device: Google Pixel 2XL Ionic: 1.7.15 cordova: 7.1.0 plugin: cordova-plugin-datepicker 0.9.3 "DatePicker"
In my ionic v1 app im trying to handle choose of date through $cordovaDatePicker. I have very minimal options like in the following code:
And im calling this
validFrom
function through$ionicPopup
template like this:When I click on
<button ng-click="validFrom()">{{ticketData.validFrom}}</button>
nothing is shown. But in logcat I see following error:Im not sure if it relevant to my project or my device, so any help would be very helpful. Thanks!