private String getLocalizedTimestamp(IWContext iwc, IWTimestamp timestamp) {
   if (timestamp == null) {
     return null;
   }
   IWCalendar cal = new IWCalendar(iwc.getCurrentLocale(), timestamp);
   if (cal != null) {
     return cal.getLocaleDate(IWCalendar.SHORT);
   } else {
     return null;
   }
 }
コード例 #2
0
  /* (non-Javadoc)
   * @see com.idega.idegaweb.widget.Widget#getWidget(com.idega.presentation.IWContext)
   */
  protected PresentationObject getWidget(IWContext iwc) {
    IWCalendar calendar = new IWCalendar(getLocale());

    String dayName = TextSoap.capitalize(calendar.getDayName(calendar.getDayOfWeek()));
    Text text =
        new Text(
            (getLocale().equals(LocaleUtil.getIcelandicLocale()) ? dayName + " " : "")
                + calendar.getLocaleDate(getLocale(), this.style));

    return text;
  }