DateUtil { public static String getPatternForDateLocale(Locale dateLocale) { SimpleDateFormat dateFormat = (SimpleDateFormat) (SimpleDateFormat.getDateInstance(DateFormat.SHORT, dateLocale)); return dateFormat.toPattern(); } private  DateUtil(); static int getWeekNumberForDate(Date date, int configuredFirstDayOfWeek); static void dayOfWeekFix(Calendar calendar); static boolean isWeekend(Calendar calendar); static int getDaysInMonth(Calendar calendar); static int getDaysInMonth(DateTime calendar); static DateRange calendarToMonthRange(Calendar calendar); static boolean isDateWithinRange(Date date, DateRange dateRange); static boolean isDateWithinRange(DateTime date, DateRange dateRange); static boolean isDateWithinRange(Calendar calendar, DateRange dateRange); static boolean isDateRangeOverlaps(DateRange rangeA, DateRange rangeB); static DateRange getDateRangeForWeek(Calendar calendar); static DateRange getDateRangeForMonth(Date date); static DateRange getDateRangeForMonth(Calendar calendar); static DateRange getDateRangeForQuarter(Calendar calendar); static Calendar addQuarter(Calendar calendar, int quarterDelta); static Date nullifyTime(Date date); static void nullifyTime(Calendar cal); static void maximizeTime(Calendar cal); static Date maximizeTime(Date date); static List<Date> createDateSequence(DateRange range, EhourConfig config); static Calendar getCalendar(EhourConfig config); static Calendar getCalendar(Date date); static String getPatternForDateLocale(Locale dateLocale); static String formatDate(Date date, Locale dateLocale); static String formatDate(DateTime date, Locale dateLocale); static String formatDate(LocalDate date, Locale dateLocale); static int fromCalendarToJodaTimeDayInWeek(int dayInWeek);  }
@Test public void should_get_proper_US_date_formatting_pattern() { assertEquals("M/d/yy", DateUtil.getPatternForDateLocale(Locale.US)); }
@Test public void should_get_proper_German_date_formatting_pattern() { assertEquals("dd.MM.yy", DateUtil.getPatternForDateLocale(Locale.GERMANY)); }
@Test public void should_get_proper_Chinese_date_formatting_pattern() { assertEquals("yy-M-d", DateUtil.getPatternForDateLocale(Locale.CHINA)); }
@Test public void should_get_proper_French_date_formatting_pattern() { assertEquals("dd/MM/yy", DateUtil.getPatternForDateLocale(Locale.FRANCE)); }
@Test public void should_get_proper_Japanese_date_formatting_pattern() { assertEquals("yy/MM/dd", DateUtil.getPatternForDateLocale(Locale.JAPAN)); }
@Test public void should_get_proper_Dutch_date_formatting_pattern() { assertEquals("d-M-yy", DateUtil.getPatternForDateLocale(new Locale("nl"))); }