I am using a DatePicker Ionic Native plugin.
I use two different selects, one to select a date, and another to select
the time. Both work fine on iOS but with Android I have two problems.
-
On Date Picker there is no bounds so that the old dates cannot be selected, even though I do pass that in controller.
showDatePicker(){ this.datePicker.show({ date: this.dateChosen, mode: 'date', minDate: this.today, maxDate: this.maxDay, allowOldDates: false }).then( date => { this.dateChosen = m(date); }, err => alert('Error occurred while getting date: ' + err) );}
I used moment.js for date/time generation, so this.dateChose = moment();
It is not the source of the problem, same for this.today
and this.maxDay
I tried using javascript’s Date()
but it did not change anything, on Android I could still select whichever date I wanted
-
More important problem is that Time Picker does not work on Android at ALL
showTimePicker(){ this.datePicker.show({ date: this.timeChosen, mode: 'time', is24Hour: true, minuteInterval: 15, allowOldDates: false }).then( date => { this.timeChosen = m(date); }, err => alert('Error occurred while getting date: ' + err) );}
On iOS I have no problem and it works just fine, but on Android it goes to err state with err message being For input string "2017-07-10T13:10.24.213Z"
.
I changed the input to pass it int of unix time but it just changed the err message. Anyone knows what to do??