AbstractCalendar calendarComponent = (AbstractCalendar) component;
Map<String, Object> map = new HashMap<String, Object>();
Locale locale = CalendarHelper.getAsLocale(facesContext, calendarComponent);
DateFormatSymbols dateFormat = new DateFormatSymbols(locale);
Calendar calendar = CalendarHelper.getCalendar(facesContext, calendarComponent);
int maximum = calendar.getActualMaximum(Calendar.DAY_OF_WEEK);
int minimum = calendar.getActualMinimum(Calendar.DAY_OF_WEEK);
int monthMax = calendar.getActualMaximum(Calendar.MONTH);
int monthMin = calendar.getActualMinimum(Calendar.MONTH);
String[] weekDayLabels = RenderKitUtils.asArray(calendarComponent.getWeekDayLabels());
if (isEmptyArray(weekDayLabels)) {
weekDayLabels = dateFormat.getWeekdays();
weekDayLabels = shiftDates(minimum, maximum, weekDayLabels);
}
RenderKitUtils.addToScriptHash(map, WEEK_DAY_LABELS, weekDayLabels);
String[] weekDayLabelsShort = RenderKitUtils.asArray(calendarComponent.getWeekDayLabelsShort());
if (isEmptyArray(weekDayLabelsShort)) {
weekDayLabelsShort = dateFormat.getShortWeekdays();
weekDayLabelsShort = shiftDates(minimum, maximum, weekDayLabelsShort);
}
RenderKitUtils.addToScriptHash(map, WEEK_DAY_LABELS_SHORT, weekDayLabelsShort);
String[] monthLabels = RenderKitUtils.asArray(calendarComponent.getMonthLabels());
if (isEmptyArray(monthLabels)) {
monthLabels = dateFormat.getMonths();
monthLabels = shiftDates(monthMin, monthMax, monthLabels);
}
RenderKitUtils.addToScriptHash(map, MONTH_LABELS, monthLabels);
String[] monthLabelsShort = RenderKitUtils.asArray(calendarComponent.getMonthLabelsShort());
if (isEmptyArray(monthLabelsShort)) {
monthLabelsShort = dateFormat.getShortMonths();
monthLabelsShort = shiftDates(monthMin, monthMax, monthLabelsShort);
}
RenderKitUtils.addToScriptHash(map, MONTH_LABELS_SHORT, monthLabelsShort);
int minDaysInFirstWeek = calendarComponent.getMinDaysInFirstWeek();