cordova-plugin-datepicker
cordova-plugin-datepicker copied to clipboard
android show current date
When I specify the date to be different of the current date, on success it shows the current date(the time is okay, the date is not)
Can you show your code? We need see what you is doing to help you...
If your date
parameter to DatePicker.show()
is correct, then it's probably because there's an error in DatePickerPlugin.java in JsonDate.fromJson()
.
For me, I got tripped up because on Android minDate
and maxDate
accept a timestamp (integer) where for iOS they accept a Date object.
I'm using Ionic 2, so my working code looks like this:
this.datePicker.show({
date: defaultDate,
mode: 'date',
maxDate: this.plt.is('android') ? Date.now() : new Date(),
})
IMO, this should be handled by the plugin but this plugin doesn't seem to be maintained any longer. I might fork it and make that improvement on my own later if no one else does sooner.