-
Notifications
You must be signed in to change notification settings - Fork 17
Open
Description
private int getDayForDate(@NonNull LocalDate date) {
return firstDay.until(date).getDays();
}
This method is supposed to get the offset of days from first day. But in fact it only get the days of month. As a result, selectDay and setDateIndicator won't work correctly.
This would be correct:
private int getDayForDate(@NonNull LocalDate date) {
return (int) (date.toEpochDay() - firstDay.toEpochDay());
}
or
private int getDayForDate(@NonNull LocalDate date) {
return (int) firstDay.until(date, ChronoUnit.DAYS);
}
tonyawino
Metadata
Metadata
Assignees
Labels
No labels