SingleDateAndTimePicker icon indicating copy to clipboard operation
SingleDateAndTimePicker copied to clipboard

WheelDatePicker resolves picked date incorrectly

Open hank-cp opened this issue 4 years ago • 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

hank-cp avatar Mar 02 '20 04:03 hank-cp

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

Tgo1014 avatar Mar 02 '20 08:03 Tgo1014

Hi,

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

Thanks Asanka

chorauoc avatar Mar 11 '20 13:03 chorauoc

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

ralphevmanzano avatar Mar 11 '20 18:03 ralphevmanzano

I am also facing the same issue

kumarswamy-repo avatar Mar 21 '20 16:03 kumarswamy-repo

@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

ralphevmanzano avatar Mar 21 '20 17:03 ralphevmanzano

what is the branch name?

kumarswamy-repo avatar Mar 22 '20 04:03 kumarswamy-repo

@kumarswamy-repo this one

ralphevmanzano avatar Mar 22 '20 06:03 ralphevmanzano

Ok. I will check and update here

kumarswamy-repo avatar Mar 22 '20 06:03 kumarswamy-repo

Now correct dates are displaying. Thanks for quick update.

kumarswamy-repo avatar Mar 22 '20 15:03 kumarswamy-repo

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

tiger1990 avatar Mar 29 '20 17:03 tiger1990