capacitor-community / date-picker

Native DateTime Picker Plugin for Capacitor Apps
MIT License
87 stars 29 forks source link

BETA: Android: Nested present config attributes not working #40

Open dimitrijuchtmans opened 3 years ago

dimitrijuchtmans commented 3 years ago

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)