String (final Date date) { myCalendar.setTime(date); if (myCurrentCalendar.get(Calendar.YEAR) == myCalendar.get(Calendar.YEAR)) { if (myCurrentCalendar.get(Calendar.DAY_OF_YEAR) == myCalendar.get(Calendar.DAY_OF_YEAR)) { return VcsBundle.message("date.group.today"); } if (myCurrentCalendar.get(Calendar.WEEK_OF_YEAR) == myCalendar.get(Calendar.WEEK_OF_YEAR)) { return myWeekDayFormatCache.get(myCalendar.get(Calendar.DAY_OF_WEEK)); } if (myCurrentCalendar.get(Calendar.WEEK_OF_YEAR) == myCalendar.get(Calendar.WEEK_OF_YEAR)+1) { return VcsBundle.message("date.group.last.week"); } return myMonthsCache.get(myCalendar.get(Calendar.MONTH)); } return myMonthYearFormat.format(date); }