DateHelper { public static String[] getShortWeekdays() { String[] days = new DateFormatSymbols(Locale.getDefault()).getShortWeekdays(); return getSortWeekdays(days, Calendar.getInstance().getFirstDayOfWeek()); } private  DateHelper(); static String format(Date dt); static String format(Date dt, String pattern); static String formatShortDate(Date dt); static String formatShortTime(Date dt); static String formatISO8601(Date dt); static Calendar getEmptyCalendar(); static Calendar calendar(int year, int month, int day); static Date date(int year, int month, int day); static Date beginOfDay(Date dt); static Date endOfDay(Date dt); static int diffDays(Date dtEnd, Date dtBegin); static Date setTime(Date date, Date time); static Date getTime(Date datetime); static boolean isOnlyTime(Date dt); static boolean isOnlyDate(Date dt); static Date addDays(Date date, int count); static boolean isEmpty(Date date); static String[] getWeekdays(); static String[] getShortWeekdays(); static int[] getIndexWeekdays(); static final String DATE_FORMAT_ISO8601; }
@Test public void testGetShortWeekdays() throws Exception { final String lang = Locale.getDefault().getLanguage(); String[] weekdays = DateHelper.getShortWeekdays(); if (lang.equals("ru")) { assertEquals("Пн", weekdays[0]); assertEquals("Вт", weekdays[1]); assertEquals("Ср", weekdays[2]); assertEquals("Чт", weekdays[3]); assertEquals("Пт", weekdays[4]); assertEquals("Сб", weekdays[5]); assertEquals("Вс", weekdays[6]); } else if (lang.equals("en")) { assertEquals("Sun", weekdays[0]); assertEquals("Mon", weekdays[1]); assertEquals("Tue", weekdays[2]); assertEquals("Wed", weekdays[3]); assertEquals("Thu", weekdays[4]); assertEquals("Fri", weekdays[5]); assertEquals("Sat", weekdays[6]); } else { fail("No test, set unknown locale"); } }