cordova-plugin-datepicker
cordova-plugin-datepicker copied to clipboard
It looks wrong on Android 7.1
It has a strange space at the right.

I can also confirm this. Extra spacing on the right side.
Its not the plugin issue ! Its according to density pixels of a device. Its a native datepicker , and same happens with it. You can check by changing pixel density on your device.
@uzumakinaruto123 Thanks for your reply. Total noob question but how does one go about changing pixel density?
@tavosansal you can try this adb command : -adb shell wm density 400 && adb reboot you can remove && adb reboot.
But , I suggest you don't do it. I keep mine at 400(one plus 3) because I like everything small.
If you want to try then , please note your default density before doing. You will have to try different values to make date picker look correct.
you can try few apps here :- https://play.google.com/store/search?q=screen%20density&c=apps
some apps require root. Anyways , this is getting off topic for the plugin.
@uzumakinaruto123 if it was a problem with the device shouldn't it display wrong in every app? for me it only displays like that on my ionic application, in every other application it is displaying right, also, if i put a <input type="date"> in my ionic app, it is showing fine, the only way I see it like this is when I use this plugin.
I agree with @escobar5 ... time picker provided by this plugin looks perfectly fine. The date picker doesn't.
Most of of the apps adjust to the changed resolution. If you have any other app using this same date picker , do check in it. Its hard to find some native app with this datepicker. But , check it if you can. What I am saying is this plugin is just cordova wrapper for native datepicker. For me , on my device if I change dpi to 480 (device deault) then datepicker looks perfect. Now , at 400 it does not. Even I am using it in Ionic. plugin just calls the native java datepicker and gets result back. maybe , I missed something. @VitaliiBlagodir can confirm
@uzumakinaruto123 I have the default dpi for my device, also tried with a couple of emulators, same result, <input type="date"> shows the same datepicker, and it shows fine.
@uzumakinaruto123 I don't think we should be messing around with a users native pixel density. The pixel densities are different because android supports a wide variety of screen sizes and resolutions. I'm sure the native datepicker is designed to handle that, however it seems there may be some extra work needed to get the plugin to match that functionality.
I never tried <input type="date"> . I will try this and check if it opens the same picker and if it looks perfect.
Update :- @escobar5 I tried it. and it does look perfect. layout is bit different and seems to be of fixed width on every device. but I never knew html input could open it. Maybe plugin will need some extra work.
Any news on this?
This is still an issue. Running an Emulator on API 28, Android 9, and this is what I'm seeing in my app with cordova-plugin-datepicker:

And this is what I see when I go into system settings:

This seems to fix: https://github.com/VitaliiBlagodir/cordova-plugin-datepicker/pull/244
The fix #244 is from 2017 but never merge.