Package io.jmix.ui.component.formatter
Class DateFormatter<V>
java.lang.Object
io.jmix.ui.component.formatter.DateFormatter<V>
-
Field Summary
Modifier and TypeFieldDescriptionprotected CurrentAuthentication
protected DateTimeTransformations
protected String
protected FormatStringsRegistry
protected String
protected boolean
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionFormats a value to a string.protected String
applyFormatInternal
(V value) void
Sets the format string describing the date format which will be used to createSimpleDateFormat
instance.void
Sets the formatter type, which can have aDATE
orDATETIME
value.void
setUseUserTimezone
(boolean useUserTimezone) Sets whether formatter should display the date and time in the current user's timezone.
-
Field Details
-
currentAuthentication
-
formatStringsRegistry
-
dateTimeTransformations
-
format
-
type
-
useUserTimezone
protected boolean useUserTimezone
-
-
Constructor Details
-
DateFormatter
public DateFormatter()
-
-
Method Details
-
setFormat
Sets the format string describing the date format which will be used to createSimpleDateFormat
instance. It can be either a format string, or a key in message group.- Parameters:
format
- a format string or a key in message group
-
setType
Sets the formatter type, which can have aDATE
orDATETIME
value. If specified, the value will be formatted by means ofDateDatatype
orDateTimeDatatype
respectively.- Parameters:
type
- a formatter type
-
setUseUserTimezone
Sets whether formatter should display the date and time in the current user's timezone.- Parameters:
useUserTimezone
-true
if the formatter displays the date and time in the current user's timezone,false
otherwise
-
apply
Description copied from interface:Formatter
Formats a value to a string. -
applyFormatInternal
-