florent37 / SingleDateAndTimePicker

You can now select a date and a time with only one widget !
Apache License 2.0
1.02k stars 333 forks source link

WheelDatePicker resolves picked date incorrectly #257

Open hank-cp opened 4 years ago

hank-cp commented 4 years ago

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

Tgo1014 commented 4 years ago

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

chorauoc commented 4 years ago

Hi,

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

Thanks Asanka

ralphevmanzano commented 4 years ago

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

kumarswamy-repo commented 4 years ago

I am also facing the same issue

ralphevmanzano commented 4 years ago

@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

kumarswamy-repo commented 4 years ago

what is the branch name?

ralphevmanzano commented 4 years ago

@kumarswamy-repo this one

kumarswamy-repo commented 4 years ago

Ok. I will check and update here

kumarswamy-repo commented 4 years ago

Now correct dates are displaying. Thanks for quick update.

tiger1990 commented 4 years ago

@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.