cordova-plugin-datepicker
cordova-plugin-datepicker copied to clipboard
Datepicker does not open in ios9
Date picker does not open in ios9 and gives a assertion failed error in the logs.
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).
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 - I think you're issue is that the options should be inside the function that opens the datepicker. :)
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 in which line you added inside DatePicker.m file ??
@aleximmauell don't know the line but I replaced the whole file.
@gaurav-chandra : when i replaced whole file and on second firing the datepicker is not working ..
@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.
webView:decidePolicyForNavigationAction:request:frame:decisionListener: delegate: <NSInternalInconsistencyException> Invalid parameter not satisfying: date .......is the error
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 : can you able to show the modified code here ...
@aleximmauell I create a PR for this: https://github.com/VitaliiBlagodir/cordova-plugin-datepicker/pull/207