Class UIDateRendererProvider
- java.lang.Object
-
- com.hybris.backoffice.renderer.utils.UIDateRendererProvider
-
public class UIDateRendererProvider extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description protected static java.lang.StringLABEL_LATERDATEprotected static java.lang.StringLABEL_TODAYprotected static java.lang.StringLABEL_UNKNOWNprotected static java.lang.StringLABEL_YESTERDAY
-
Constructor Summary
Constructors Constructor Description UIDateRendererProvider()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetFormattedDateLabel(java.util.Date now, java.util.Date referenceDate)protected java.util.TimeZonegetFormatTimeZone()protected java.lang.StringgetI18NLabelKey(java.util.Date now, java.util.Date referenceDate)protected java.lang.StringgetLabel(java.lang.String labelKey, java.lang.String timeFormat, java.lang.String dateFormat)protected java.lang.StringgetLabel(java.lang.String labelKey, java.text.DateFormat timeFormat, java.text.DateFormat dateFormat, java.util.Date referenceDate)
-
-
-
Field Detail
-
LABEL_LATERDATE
protected static final java.lang.String LABEL_LATERDATE
- See Also:
- Constant Field Values
-
LABEL_TODAY
protected static final java.lang.String LABEL_TODAY
- See Also:
- Constant Field Values
-
LABEL_UNKNOWN
protected static final java.lang.String LABEL_UNKNOWN
- See Also:
- Constant Field Values
-
LABEL_YESTERDAY
protected static final java.lang.String LABEL_YESTERDAY
- See Also:
- Constant Field Values
-
-
Method Detail
-
getFormattedDateLabel
public java.lang.String getFormattedDateLabel(java.util.Date now, java.util.Date referenceDate)- Parameters:
now-referenceDate-- Returns:
- formatted value for Label. If
referenceDateis today in reference tonow, then the returned value is "Today - {time}", when is yesterday then returned value is "Yesterday - {time}", otherwise is {date} - {time}. "Today" and "Yesterday" labels can be localized. If one of the inputs is null then "Unknown" is returned.
-
getI18NLabelKey
protected java.lang.String getI18NLabelKey(java.util.Date now, java.util.Date referenceDate)
-
getLabel
protected java.lang.String getLabel(java.lang.String labelKey, java.text.DateFormat timeFormat, java.text.DateFormat dateFormat, java.util.Date referenceDate)
-
getLabel
protected java.lang.String getLabel(java.lang.String labelKey, java.lang.String timeFormat, java.lang.String dateFormat)
-
getFormatTimeZone
protected java.util.TimeZone getFormatTimeZone()
-
-