florent37/SingleDateAndTimePicker

WheelDatePicker resolves picked date incorrectly

hank-cp opened this issue · 10 comments

WheelDatePicker.convertItemToDate() resolves picked date incorrectly.

This following line of code always return -1, because adapter is holding DateWithLabel, not String from getTodayText().

final int todayPosition = adapter.getData().indexOf(getTodayText());

This results every time picking a date, year is added. e.g. picking 2020/1/1, returns 2021/1/1.

Version: 2.2.0

I'm having the same issue. If I start the picker with today when I select yesterday in the picker it returns 2022. I'm having a issue as well that if I start it with today (March, 2) the picker shows 2 days ahead instead (March, 4). It's skipping dates as well, you can see it doesn't show 2 or 3 of March.

image

Hi,

I am also having this issue, when you able to fix this issue

Thanks
Asanka

Subscribing to this, I am facing the same issue as well

I am also facing the same issue

@kumarswamy-repo yea, idk when my code will be merged but you can test my branch, download it and add the library as aar to your project

what is the branch name?

Ok. I will check and update here

Now correct dates are displaying. Thanks for quick update.

@ralphevmanzano I just took an update of your branch, Still facing same issue. When choosing date before minimum date range, scroller scroll and adapter got updated, and issue comes again.