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

init StartTime and EndTime by calendar. #2

Closed
nguyencongbinh opened this issue Jun 10, 2021 · 1 comment
Closed

init StartTime and EndTime by calendar. #2

nguyencongbinh opened this issue Jun 10, 2021 · 1 comment

Comments

@nguyencongbinh
Copy link

Great library.
How can I pass a calendar to set StartTime and EndTime for Picker?
**picker.setStartTime(calendar);**

I tried to use setStartTimeMinutes but seem it is not correct.

picker.setStartTimeMinutes((int) TimeUnit.MILLISECONDS.toMinutes(Calendar.getInstance().getTimeInMillis()));

@nguyencongbinh
Copy link
Author

I found the solution
int hourOfDay = calendarStart.get(Calendar.HOUR_OF_DAY);
int minute = calendarStart.get(Calendar.MINUTE);
int value = hourOfDay * 60 + minute;
picker.setStartTimeMinutes(value);

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

1 participant