Open smhemel opened 1 year ago
I'm getting this same issue, did you manage to find a solution @smhemel ? :)
@DanielDarrenJones No, I didn't find any solution. But, I implemented a custom date-picker component using
We've faced the same error in our project recently. In our case we were passing the following data to the DatePicker:
let { value: newValue } = await DatePicker.present({
mode, // "time"
date: value || dateSuggestion || undefined, // 24-hour formatted time string
timezone,
format: dateFormat, // "HH:mm"
is24h: true,
ios: {
timezone,
format: dateFormat,
style: 'wheels',
mode,
},
android: {
timezone,
format: dateFormat,
mode,
},
});
Despite the fact we explicitly passed the is24h
and format
params the plugin used the device's platform built-in Date formatter (DateFormatter
from the Foundation code) - so devices with the 12 hour
locale tried to parse the 24-hour formatted time, which returned nil
. The things became worse because there's a "must-have-a-value" operator used:
// client/node_modules/@capacitor-community/date-picker/ios/Plugin/Parse.swift
return formatter.date(from: date)!;
// ^--- here
Same error. @smhemel any idea ?
Same error. @smhemel any idea ?
@Kamsou I didn't find any solution. Also, I did R&D to find an alternative date-picker plugin for the capacitor, but I didn't.
After that, I implemented a custom date-picker component using
Describe the bug Date Picker is not showing up. Getting Fatal error when I call atePicker.present() with valid options on Xcode.
My code:
Error in Xcode:
CapacitorCommunityDatePicker/Parse.swift:20: Fatal error: Unexpectedly found nil while unwrapping an Optional value