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

Datepicker does not open in ios9

Open mikevic opened this issue 8 years ago • 12 comments

Date picker does not open in ios9 and gives a assertion failed error in the logs.

mikevic avatar May 21 '16 06:05 mikevic

Did you get this resolved? FYI I just moved to cordova 6 (6.1.1) and ios 7+ target and have had all sorts of collateral issues with other plugins, but this one has worked fine after I removed and re-added (all of my plugins).

blythburgh avatar May 23 '16 14:05 blythburgh

Same here. It does not work after I open it once, I cannot open it the second time:

*** Assertion failure in -[_UIDatePickerView _setDate:animated:forced:], /BuildRoot/Library/Caches/com.apple.xbs/Sources/UIKit/UIKit-3512.60.12/_UIDatePickerView.m:307
2016-05-31 10:33:06.184 My Health History[3266:1179425] *** WebKit discarded an uncaught exception in the webView:decidePolicyForNavigationAction:request:frame:decisionListener: delegate: <NSInternalInconsistencyException> Invalid parameter not satisfying: date

I get the above error when I try opening it again.

gaurav-chandra avatar May 31 '16 05:05 gaurav-chandra

@gaurav-chandra - I think you're issue is that the options should be inside the function that opens the datepicker. :)

mikevic avatar May 31 '16 05:05 mikevic

No, the issue was with DatePicker.m file. I changed it to the following commit:

https://github.com/VitaliiBlagodir/cordova-plugin-datepicker/pull/177/commits/a7df265092f354f453b271c18b99f346538e6286

and it worked like a charm.

gaurav-chandra avatar May 31 '16 05:05 gaurav-chandra

gaurav in which line you added inside DatePicker.m file ??

aleximmauell avatar Aug 04 '16 06:08 aleximmauell

@aleximmauell don't know the line but I replaced the whole file.

gaurav-chandra avatar Aug 04 '16 07:08 gaurav-chandra

@gaurav-chandra : when i replaced whole file and on second firing the datepicker is not working ..

aleximmauell avatar Aug 09 '16 05:08 aleximmauell

@aleximmauell this might mean the file has the same old code. The original file had this problem of not opening the datepicker the second time. The fork works for me. You need to check the xcode editor for error highlighting.

gaurav-chandra avatar Aug 09 '16 05:08 gaurav-chandra

webView:decidePolicyForNavigationAction:request:frame:decisionListener: delegate: <NSInternalInconsistencyException> Invalid parameter not satisfying: date .......is the error

aleximmauell avatar Aug 16 '16 10:08 aleximmauell

The only time I have hit this issue is if I don't pass a date in on the options. In DatePicker.js, if no date is passed in the defaults use "new Date()", and the formatDate() function isn't called. If you pass in a date when calling show() then the formatDate() function is called and iOS doesn't blow up trying to show the picker with the "Invalid parameter not satisfying: date" error message.

aoathout avatar Sep 16 '16 16:09 aoathout

@aoathout : can you able to show the modified code here ...

aleximmauell avatar Sep 21 '16 04:09 aleximmauell

@aleximmauell I create a PR for this: https://github.com/VitaliiBlagodir/cordova-plugin-datepicker/pull/207

aoathout avatar Sep 21 '16 16:09 aoathout