Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to select date (in latest release) #1053

Open
shahzad1 opened this issue Jul 9, 2020 · 2 comments
Open

Unable to select date (in latest release) #1053

shahzad1 opened this issue Jul 9, 2020 · 2 comments

Comments

@shahzad1
Copy link

shahzad1 commented Jul 9, 2020

I'm trying to select date using CalendarDay calendarDay = CalendarDay.today(); calendarView.setSelectedDate(calendarDay);

But it shows this error **error: cannot access LocalDate class file for org.threeten.bp.LocalDate not found**
I also tried CalendarDay calendarDay = CalendarDay.from(year, month, day); calendarView.setSelectedDate(calendarDay);

and this is how i'm getting Day, Month & Year

Calendar calendar = Calendar.getInstance(); int day = calendar.get(Calendar.DAY_OF_MONTH); int month = calendar.get(Calendar.MONTH) + 1; int year = calendar.get(Calendar.YEAR);

I'm currently using latest release implementation 'com.github.prolificinteractive:material-calendarview:2.0.1'

@anallur
Copy link

anallur commented Jul 9, 2020

The latest versions of Material CalendarView library uses LocalDate instead of Calendar class from Java Util. You will need to add dependency of com.jakewharton.threetenabp:threetenabp:$version in ur build.gradle

@aivision369
Copy link

I am facing same issue and I got solution after adding this library in the build.gradle file.
implementation 'com.jakewharton.threetenabp:threetenabp:1.2.1'

and I have implemented code as below :
materialCalendarView.setSelectedDate(CalendarDay.today());

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants