Class ListGridDateFormatter
java.lang.Object
com.jbstrap.ui.components.listgrid.formatters.ListGridDateFormatter
- All Implemented Interfaces:
ListGridCellFormatter
,ListGridCellFormatterCustomFormat
Date formatter class for the ListGrid
.
The class formats a date value to a value comprehensible to the user.
The class formats the received value to the framework’s default time format.
The default time format can be set using the JBStrapParamType.DATETIME_FORMAT
parameter.
Additionally, custom date formats can also be specified.
If specified, the custom date format is used to convert the value.
- Since:
- 4.0
- Author:
- JBStrap
-
Constructor Summary
-
Method Summary
-
Constructor Details
-
ListGridDateFormatter
public ListGridDateFormatter()
-
-
Method Details
-
setFormat
Sets the date format for value conversion.- Specified by:
setFormat
in interfaceListGridCellFormatterCustomFormat
- Parameters:
format
- The format to be used Ifnull
is specified, the formatter uses the framework’s default date format. The framework’s default date and time format can be set using the JBStrap parameterJBStrapParamType.DATE_FORMAT
.- Returns:
- Date formatter class
-
format
Formats the received value.- Specified by:
format
in interfaceListGridCellFormatter
- Parameters:
data
- The value to be formatted- Returns:
- If the received value is a
Date
value, the date value in text format or in other cases an empty string is returned using the defined date format.
-