cordova-plugin-datepicker icon indicating copy to clipboard operation
cordova-plugin-datepicker copied to clipboard

android show current date

Open elenabliznakova opened this issue 8 years ago • 2 comments

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)

elenabliznakova avatar Jan 19 '17 15:01 elenabliznakova

Can you show your code? We need see what you is doing to help you...

John-Henrique avatar Feb 05 '17 23:02 John-Henrique

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.

cmorbitzer avatar Mar 27 '17 08:03 cmorbitzer