@SuppressWarnings("null")
@Override
public String getTitleDisplayText(final DatePanel<T> thePanel) {
final GwtLocalDateModel currentDay = thePanel.getStartDate();
final long duration = thePanel.getDuration();
if (currentDay != null) {
switch (thePanel.getType()) {
case MONTH:
final GwtLocalDateModel monthDay = Dates.changeDay(currentDay, 14);
final String month = LocaleInfo.getCurrentLocale().getDateTimeFormatInfo().monthsFullStandalone()[monthDay.getMonth() - 1];
return CalWidgetRs.FMT.monthTitle(month, monthDay.getYear());
case WEEK:
case WEEK_TAG:
case _3_DAYS:
case _3_DAYS_TAG:
case _5_DAYS:
case _5_DAYS_TAG:
return Dates.printDateRange(currentDay, Ints.saturatedCast(duration / SharedDates.DAY_LENGTH), true);
case LIST:
return CalWidgetRs.FMT.listTitle(Dates.printDateWoYear(currentDay), Dates.printDateWoYear(Dates.change(currentDay, thePanel.getDuration(), MomentKey.MILLISECONDS)), currentDay.getYear());
case DAY:
case DAY_TAG:
default:
return Dates.printDate(currentDay);
}
}
return Uis.NOTHING;
}