@Test public void shouldReturnDayForDate() throws Exception { String dayName = DateUtil.getDayName("01-09-2015"); assertThat(dayName, is("Tue")); }
public static String getDayName(String dateString) { DateFormat formatter = new SimpleDateFormat("dd-MM-yyyy"); Date date = null; try { date = formatter.parse(dateString); } catch (ParseException e) {} Calendar calendar = Calendar.getInstance(); calendar.setTime(date); return calendar.getDisplayName(Calendar.DAY_OF_WEEK, Calendar.SHORT, Locale.US); }
DateUtil { public static String getDayName(String dateString) { DateFormat formatter = new SimpleDateFormat("dd-MM-yyyy"); Date date = null; try { date = formatter.parse(dateString); } catch (ParseException e) {} Calendar calendar = Calendar.getInstance(); calendar.setTime(date); return calendar.getDisplayName(Calendar.DAY_OF_WEEK, Calendar.SHORT, Locale.US); } }
DateUtil { public static String getDayName(String dateString) { DateFormat formatter = new SimpleDateFormat("dd-MM-yyyy"); Date date = null; try { date = formatter.parse(dateString); } catch (ParseException e) {} Calendar calendar = Calendar.getInstance(); calendar.setTime(date); return calendar.getDisplayName(Calendar.DAY_OF_WEEK, Calendar.SHORT, Locale.US); }  }
DateUtil { public static String getDayName(String dateString) { DateFormat formatter = new SimpleDateFormat("dd-MM-yyyy"); Date date = null; try { date = formatter.parse(dateString); } catch (ParseException e) {} Calendar calendar = Calendar.getInstance(); calendar.setTime(date); return calendar.getDisplayName(Calendar.DAY_OF_WEEK, Calendar.SHORT, Locale.US); }  static String getCurrentDate(); static ArrayList<String> getCurrentWeeksDates(); static String currentMonthOfYear(); static String getDayName(String dateString); }
DateUtil { public static String getDayName(String dateString) { DateFormat formatter = new SimpleDateFormat("dd-MM-yyyy"); Date date = null; try { date = formatter.parse(dateString); } catch (ParseException e) {} Calendar calendar = Calendar.getInstance(); calendar.setTime(date); return calendar.getDisplayName(Calendar.DAY_OF_WEEK, Calendar.SHORT, Locale.US); }  static String getCurrentDate(); static ArrayList<String> getCurrentWeeksDates(); static String currentMonthOfYear(); static String getDayName(String dateString); static final String DATE_FORMAT; }