@Test public void testGetFirstWeekDifferentMonth() throws Exception { LocalDate date = LocalDate.parse("2014-08-01"); RangeUnit unit = new Month(date, date, date.plusDays(2), date.plusMonths(3)); assertEquals(0, unit.getFirstWeek(date.plusMonths(1).plusWeeks(1))); }
public int getFirstWeek(@Nullable LocalDate firstDayOfMonth) { LocalDate from = getFrom(); LocalDate date; if (mMinDate != null && mMinDate.isAfter(from)) { date = mMinDate; } else { date = firstDayOfMonth; } return getWeekInMonth(date); }
RangeUnit extends CalendarUnit { public int getFirstWeek(@Nullable LocalDate firstDayOfMonth) { LocalDate from = getFrom(); LocalDate date; if (mMinDate != null && mMinDate.isAfter(from)) { date = mMinDate; } else { date = firstDayOfMonth; } return getWeekInMonth(date); } }
RangeUnit extends CalendarUnit { public int getFirstWeek(@Nullable LocalDate firstDayOfMonth) { LocalDate from = getFrom(); LocalDate date; if (mMinDate != null && mMinDate.isAfter(from)) { date = mMinDate; } else { date = firstDayOfMonth; } return getWeekInMonth(date); } protected  RangeUnit(@NonNull LocalDate from, @NonNull LocalDate to, @NonNull LocalDate today,
            @Nullable LocalDate minDate, @Nullable LocalDate maxDate); }
RangeUnit extends CalendarUnit { public int getFirstWeek(@Nullable LocalDate firstDayOfMonth) { LocalDate from = getFrom(); LocalDate date; if (mMinDate != null && mMinDate.isAfter(from)) { date = mMinDate; } else { date = firstDayOfMonth; } return getWeekInMonth(date); } protected  RangeUnit(@NonNull LocalDate from, @NonNull LocalDate to, @NonNull LocalDate today,
            @Nullable LocalDate minDate, @Nullable LocalDate maxDate); @Nullable LocalDate getMinDate(); @Nullable LocalDate getMaxDate(); int getFirstWeek(@Nullable LocalDate firstDayOfMonth); }
RangeUnit extends CalendarUnit { public int getFirstWeek(@Nullable LocalDate firstDayOfMonth) { LocalDate from = getFrom(); LocalDate date; if (mMinDate != null && mMinDate.isAfter(from)) { date = mMinDate; } else { date = firstDayOfMonth; } return getWeekInMonth(date); } protected  RangeUnit(@NonNull LocalDate from, @NonNull LocalDate to, @NonNull LocalDate today,
            @Nullable LocalDate minDate, @Nullable LocalDate maxDate); @Nullable LocalDate getMinDate(); @Nullable LocalDate getMaxDate(); int getFirstWeek(@Nullable LocalDate firstDayOfMonth);  }