/** * Returns the current date and time as String formatted in localized pattern.<p> * * @return the current date and time as String formatted in localized pattern */ public String getCurrentDateTime() { // get the current date & time return CmsCalendarWidget.getCalendarLocalizedTime(getLocale(), getMessages(), System.currentTimeMillis()); }
/** * Returns the current date and time as String formatted in localized pattern.<p> * * @return the current date and time as String formatted in localized pattern */ public String getCurrentDateTime() { // get the current date & time return CmsCalendarWidget.getCalendarLocalizedTime(getLocale(), getMessages(), System.currentTimeMillis()); }
/** * Returns the current date and time as String formatted in localized pattern.<p> * * @return the current date and time as String formatted in localized pattern */ public String getCurrentDateTime() { // get the current date & time return CmsCalendarWidget.getCalendarLocalizedTime(getLocale(), getMessages(), System.currentTimeMillis()); }
/** * Returns the current date and time as String formatted in localized pattern.<p> * * @return the current date and time as String formatted in localized pattern */ public String getCurrentDateTime() { // get the current date & time return CmsCalendarWidget.getCalendarLocalizedTime(getLocale(), getMessages(), System.currentTimeMillis()); }
/** * @see org.opencms.widgets.A_CmsWidget#getWidgetStringValue(org.opencms.file.CmsObject, org.opencms.widgets.I_CmsWidgetDialog, org.opencms.widgets.I_CmsWidgetParameter) */ @Override public String getWidgetStringValue(CmsObject cms, I_CmsWidgetDialog widgetDialog, I_CmsWidgetParameter param) { String result = param.getStringValue(cms); if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(result) && !"0".equals(result)) { try { result = getCalendarLocalizedTime( widgetDialog.getLocale(), widgetDialog.getMessages(), Long.parseLong(result)); } catch (NumberFormatException e) { if (!CmsMacroResolver.isMacro(result, CmsMacroResolver.KEY_CURRENT_TIME)) { // neither long nor macro, show empty value result = ""; } } } else { result = ""; } return result; }
/** * @see org.opencms.widgets.A_CmsWidget#getWidgetStringValue(org.opencms.file.CmsObject, org.opencms.widgets.I_CmsWidgetDialog, org.opencms.widgets.I_CmsWidgetParameter) */ @Override public String getWidgetStringValue(CmsObject cms, I_CmsWidgetDialog widgetDialog, I_CmsWidgetParameter param) { String result = param.getStringValue(cms); if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(result) && !"0".equals(result)) { try { result = getCalendarLocalizedTime( widgetDialog.getLocale(), widgetDialog.getMessages(), Long.parseLong(result)); } catch (NumberFormatException e) { if (!CmsMacroResolver.isMacro(result, CmsMacroResolver.KEY_CURRENT_TIME)) { // neither long nor macro, show empty value result = ""; } } } else { result = ""; } return result; }
/** * Get the "user timewparp" setting in form of a formatted date string.<p> * * If no timewarp has been chosen, a value "-" will be returned.<p> * * @return the "user timewarp" setting in form of a formatted date string */ public String getParamTabWpTimewarp() { String result; if (m_userSettings.getTimeWarp() == CmsContextInfo.CURRENT_TIME) { result = "-"; } else { result = CmsCalendarWidget.getCalendarLocalizedTime( getLocale(), getMessages(), m_userSettings.getTimeWarp()); } return result; }
/** * Get the "user timewparp" setting in form of a formatted date string.<p> * * If no timewarp has been chosen, a value "-" will be returned.<p> * * @return the "user timewarp" setting in form of a formatted date string */ public String getParamTabWpTimeWarp() { String result; if (m_userSettings.getTimeWarp() == CmsContextInfo.CURRENT_TIME) { result = "-"; } else { result = CmsCalendarWidget.getCalendarLocalizedTime( getLocale(), getMessages(), m_userSettings.getTimeWarp()); } return result; }
/** * Returns the current expire date as String formatted in localized pattern.<p> * * @return the current expire date as String formatted in localized pattern */ public String getCurrentExpireDate() { // get the expiration date if (isMultiOperation()) { return CmsTouch.DEFAULT_DATE_STRING; } else { try { CmsResource res = getCms().readResource(getParamResource(), CmsResourceFilter.IGNORE_EXPIRATION); if (res.getDateExpired() == CmsResource.DATE_EXPIRED_DEFAULT) { return CmsTouch.DEFAULT_DATE_STRING; } else { return CmsCalendarWidget.getCalendarLocalizedTime(getLocale(), getMessages(), res.getDateExpired()); } } catch (CmsException e) { return CmsCalendarWidget.getCalendarLocalizedTime( getLocale(), getMessages(), System.currentTimeMillis()); } } }
/** * Returns the current expire date as String formatted in localized pattern.<p> * * @return the current expire date as String formatted in localized pattern */ public String getCurrentExpireDate() { // get the expiration date if (isMultiOperation()) { return CmsTouch.DEFAULT_DATE_STRING; } else { try { CmsResource res = getCms().readResource(getParamResource(), CmsResourceFilter.IGNORE_EXPIRATION); if (res.getDateExpired() == CmsResource.DATE_EXPIRED_DEFAULT) { return CmsTouch.DEFAULT_DATE_STRING; } else { return CmsCalendarWidget.getCalendarLocalizedTime(getLocale(), getMessages(), res.getDateExpired()); } } catch (CmsException e) { return CmsCalendarWidget.getCalendarLocalizedTime( getLocale(), getMessages(), System.currentTimeMillis()); } } }
/** * Returns the current release date as String formatted in localized pattern.<p> * * @return the current release date as String formatted in localized pattern */ public String getCurrentReleaseDate() { // get the release date if (isMultiOperation()) { return CmsTouch.DEFAULT_DATE_STRING; } else { try { CmsResource res = getCms().readResource(getParamResource(), CmsResourceFilter.IGNORE_EXPIRATION); if (res.getDateReleased() == CmsResource.DATE_RELEASED_DEFAULT) { return CmsTouch.DEFAULT_DATE_STRING; } else { return CmsCalendarWidget.getCalendarLocalizedTime(getLocale(), getMessages(), res.getDateReleased()); } } catch (CmsException e) { return CmsCalendarWidget.getCalendarLocalizedTime( getLocale(), getMessages(), System.currentTimeMillis()); } } }
/** * Returns the current release date as String formatted in localized pattern.<p> * * @return the current release date as String formatted in localized pattern */ public String getCurrentReleaseDate() { // get the release date if (isMultiOperation()) { return CmsTouch.DEFAULT_DATE_STRING; } else { try { CmsResource res = getCms().readResource(getParamResource(), CmsResourceFilter.IGNORE_EXPIRATION); if (res.getDateReleased() == CmsResource.DATE_RELEASED_DEFAULT) { return CmsTouch.DEFAULT_DATE_STRING; } else { return CmsCalendarWidget.getCalendarLocalizedTime( getLocale(), getMessages(), res.getDateReleased()); } } catch (CmsException e) { return CmsCalendarWidget.getCalendarLocalizedTime( getLocale(), getMessages(), System.currentTimeMillis()); } } }