Package org.opencms.workplace.list
Class CmsListDateMacroFormatter
java.lang.Object
org.opencms.workplace.list.CmsListMacroFormatter
org.opencms.workplace.list.CmsListDateMacroFormatter
- All Implemented Interfaces:
I_CmsListFormatter
Formatter for dates.
The 'never' message will be displayed if the date is null or
.Date.getTime()
==0
- Since:
- 6.0.0
-
Constructor Summary
ConstructorDescriptionCmsListDateMacroFormatter
(org.opencms.i18n.CmsMessageContainer mask, org.opencms.i18n.CmsMessageContainer never) Default constructor that sets the mask to use.CmsListDateMacroFormatter
(org.opencms.i18n.CmsMessageContainer mask, org.opencms.i18n.CmsMessageContainer never, long neverTime) Default constructor that sets the mask to use. -
Method Summary
Modifier and TypeMethodDescriptionReturns a formatted string for the specified data.static I_CmsListFormatter
Returns a default date formatter object.static I_CmsListFormatter
getDefaultDateFormatter
(long never) Returns a default date formatter object.Methods inherited from class org.opencms.workplace.list.CmsListMacroFormatter
getMask
-
Constructor Details
-
CmsListDateMacroFormatter
public CmsListDateMacroFormatter(org.opencms.i18n.CmsMessageContainer mask, org.opencms.i18n.CmsMessageContainer never) Default constructor that sets the mask to use.- Parameters:
mask
- pattern forMessageFormat
never
- message (without args) for the 'never' message
-
CmsListDateMacroFormatter
public CmsListDateMacroFormatter(org.opencms.i18n.CmsMessageContainer mask, org.opencms.i18n.CmsMessageContainer never, long neverTime) Default constructor that sets the mask to use.- Parameters:
mask
- pattern forMessageFormat
never
- message (without args) for the 'never' messageneverTime
- the time considered as 'never', default is0
-
-
Method Details
-
getDefaultDateFormatter
Returns a default date formatter object.- Returns:
- a default date formatter object
-
getDefaultDateFormatter
Returns a default date formatter object.- Parameters:
never
- time considered as never- Returns:
- a default date formatter object
-
format
Description copied from interface:I_CmsListFormatter
Returns a formatted string for the specified data.Take care of
null
data.- Specified by:
format
in interfaceI_CmsListFormatter
- Overrides:
format
in classCmsListMacroFormatter
- Parameters:
data
- the data to formatlocale
- the locale for formatting- Returns:
- formatted data
- See Also:
-