Merge pull request #9 from TouchInstinct/bugs/calendar-fix

Anton Domnikov calendar fix
This commit is contained in:
Gavriil 2016-11-07 18:13:25 +03:00 committed by GitHub
commit cacbe26c6d
1 changed files with 4 additions and 4 deletions

View File

@ -258,12 +258,12 @@ public final class CalendarUtils {
int shift = calendarItems.get(calendarItems.size() - 1).getEndRange();
final DateTime nextMonthFirstDay = dateTime.plusDays(1);
final int firstFayInNextMonth = nextMonthFirstDay.getDayOfWeek() - 1;
calendarItems.add(new CalendarEmptyItem(shift, shift + (7 - firstFayInNextMonth) - 1));
shift += 7 - firstFayInNextMonth;
final int firstDayInNextMonth = nextMonthFirstDay.getDayOfWeek() - 1;
calendarItems.add(new CalendarEmptyItem(shift + 1, shift + (7 - firstDayInNextMonth)));
shift += 7 - firstDayInNextMonth + 1;
calendarItems.add(new CalendarHeaderItem(nextMonthFirstDay.getMonthOfYear() + 1, shift, shift));
shift += 1;
calendarItems.add(new CalendarEmptyItem(shift, shift + firstFayInNextMonth - 1));
calendarItems.add(new CalendarEmptyItem(shift, shift + firstDayInNextMonth - 1));
}
private CalendarUtils() {