capacitor-community / capacitor-community/date-picker
BETA: Android: Nested present config attributes not working
- Dominant language
- Swift
- Stars
- 94
- Forks
- 30
- PR merge metrics
- No merged PRs in 30d
Description
**Describe the bug**
I pass a dd-MM-yyy format to my DatePickerPlugin present function as part of the android configuration. my capacitor config has no default set, so by default plugin takes iso standard.
The more specific format is not overriding the default one.
This causes the app to crash with a parsing error on the dates.
**To Reproduce**
Steps to reproduce the behavior:
1. call DatePickerPlugin.present with a custom format, described in android: { format: 'dd-MM-yyyy'} for example
2. Open debug mode in android studio or whatever :).
3. Plugin calls the method PluginCall.getString(key, default) internally, but this capacitor method does not support nested keys.
**Expected behavior**
DatepickerPlugin.java should run custom code when dealing with nested json paths.
**Screenshots**
If applicable, add screenshots to help explain your problem.
**Additional context**
A temporary workaround is proably to have my dd-MM-yyy format described in the deprecated top level format config attribute ( or capacitor.config.json)
Contributor guide
Research direction
Start in DatePickerPlugin.java and inspect how the Android format is read from the nested configuration, especially the PluginCall.getString(key, default) call mentioned in the report. Confirm that a format passed under android overrides the ISO default and that the deprecated top-level workaround is no longer required.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, java
- Domain
- mobile-dev
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100