// month minus a millisecond.
calcCal.set(Calendar.DAY_OF_MONTH, lastDOM);
calcCal.add(Calendar.DATE, 1);
long lastDOMTime = calcCal.getTimeInMillis() - 1;
DateFormatSymbols dateSymbols = _getDateFormatSymbols(arc);
int firstDOW = displayedCalendar.getMinimum(Calendar.DAY_OF_WEEK);
int lastDOW = displayedCalendar.getMaximum(Calendar.DAY_OF_WEEK);
int dowCount = lastDOW - firstDOW + 1;
//
// Write the month and year drop downs
//
// If we're running in inline mode, make sure we have
// access to the necessary scripts
if (isInline)
XhtmlUtils.addLib(context, arc, "_calsd()");
// make sure that the js lib is added
XhtmlUtils.addLib(context, arc, "_updateCal()");
String baseNavURL = _createNavURL(arc,
destString,
minTime,
maxTime,
selectedTime,
id);
writer.startElement("tr", null);
// render the previous button
_renderNextPrev(context,
arc,
component,
bean,
true,
minTime,
firstDOMTime,
baseNavURL,
isInline);
writer.startElement("td", null);
writer.writeAttribute("colspan", IntegerUtils.getString(dowCount - 2), null);
renderStyleClass(context, arc, styles.TITLE_STYLE);
// don't wrap the month and year controls
writer.writeAttribute("nowrap", Boolean.TRUE, null);
_renderMonthAndYear(context,
arc,
minTime,
maxTime,
displayedCalendar,
dateSymbols,
baseNavURL,
id,
isInline);
writer.endElement("td");
// render the next button
_renderNextPrev(context,
arc,
component,
bean,
false,
maxTime,
lastDOMTime,
baseNavURL,
isInline);
writer.endElement("tr");
// Place the rest of the calendar content within its own
// table, so that we can style the calendar's border
writer.startElement("tr", null);
writer.startElement("td", null);
writer.writeAttribute("colspan", IntegerUtils.getString(dowCount), null);
writer.startElement("table", null);
//fix for bug 4410632: added summary attribute
OutputUtils.renderDataTableAttributes(context,
arc,
"0", "0", "0", "100%",
arc.getTranslatedString("af_chooseDate.SUMMARY"));
renderStyleClass(context, arc, styles.CONTENT_STYLE);
//
// Write the day of the week headers
//
writer.startElement("tr", null);
renderStyleClass(context, arc, styles.HEADER_STYLE);
String[] shortWeekdays;
// Bug 2388968: Java's "short" weekdays in Arabic are single
// letters, which we're told are inadequate. Output entire
// names instead.
if ("ar".equals(arc.getLocaleContext().getFormattingLocale().getLanguage()))
shortWeekdays = dateSymbols.getWeekdays();
else
shortWeekdays = dateSymbols.getShortWeekdays();
for (int i = firstDOW; i <= lastDOW; i++)
{
writer.startElement("th", null);
writer.writeAttribute("scope", "col", null);