@Test public void testGetHeaderTextMonth() throws Exception { String headerText = formatter.getHeaderText(CalendarUnit.TYPE_MONTH, new LocalDate(2015, 4, 1), new LocalDate(2015, 4, 30)); assertEquals("April 2015", headerText); }
@Override public String getHeaderText(@CalendarType int type, @NonNull LocalDate from, @NonNull LocalDate to) { switch (type) { case CalendarUnit.TYPE_WEEK: return from.toString(weekHeaderFormatter); case CalendarUnit.TYPE_MONTH: return from.toString(monthHeaderFormatter); default: throw new IllegalStateException("Unknown calendar type"); } }
DefaultFormatter implements Formatter { @Override public String getHeaderText(@CalendarType int type, @NonNull LocalDate from, @NonNull LocalDate to) { switch (type) { case CalendarUnit.TYPE_WEEK: return from.toString(weekHeaderFormatter); case CalendarUnit.TYPE_MONTH: return from.toString(monthHeaderFormatter); default: throw new IllegalStateException("Unknown calendar type"); } } }
DefaultFormatter implements Formatter { @Override public String getHeaderText(@CalendarType int type, @NonNull LocalDate from, @NonNull LocalDate to) { switch (type) { case CalendarUnit.TYPE_WEEK: return from.toString(weekHeaderFormatter); case CalendarUnit.TYPE_MONTH: return from.toString(monthHeaderFormatter); default: throw new IllegalStateException("Unknown calendar type"); } } DefaultFormatter();  DefaultFormatter(@NonNull String dayPattern, @NonNull String weekPattern, @NonNull String monthPattern); }
DefaultFormatter implements Formatter { @Override public String getHeaderText(@CalendarType int type, @NonNull LocalDate from, @NonNull LocalDate to) { switch (type) { case CalendarUnit.TYPE_WEEK: return from.toString(weekHeaderFormatter); case CalendarUnit.TYPE_MONTH: return from.toString(monthHeaderFormatter); default: throw new IllegalStateException("Unknown calendar type"); } } DefaultFormatter();  DefaultFormatter(@NonNull String dayPattern, @NonNull String weekPattern, @NonNull String monthPattern); @Override String getDayName(@NonNull LocalDate date); @Override String getHeaderText(@CalendarType int type, @NonNull LocalDate from, @NonNull LocalDate to); }
DefaultFormatter implements Formatter { @Override public String getHeaderText(@CalendarType int type, @NonNull LocalDate from, @NonNull LocalDate to) { switch (type) { case CalendarUnit.TYPE_WEEK: return from.toString(weekHeaderFormatter); case CalendarUnit.TYPE_MONTH: return from.toString(monthHeaderFormatter); default: throw new IllegalStateException("Unknown calendar type"); } } DefaultFormatter();  DefaultFormatter(@NonNull String dayPattern, @NonNull String weekPattern, @NonNull String monthPattern); @Override String getDayName(@NonNull LocalDate date); @Override String getHeaderText(@CalendarType int type, @NonNull LocalDate from, @NonNull LocalDate to);  }