Package com.thepluginpeople.jemhod.api
Interface ITemplateDateFormatter
public interface ITemplateDateFormatter
Bean that allows user to render dates in templates.
The date formatter/parsers will use the configured Timezone.
- Author:
- Fernado Boucquez
-
Method Summary
Modifier and TypeMethodDescriptionFormats a date form the object using the provided pattern.formatDate
(Object value) Formats the date of a date resolved form the object.formatDateTime
(Object value) Formats the datetime of a date resolved form the object.Formats the day of a date resolved form the object.formatTime
(Object value) Formats the time of a date resolved form the object.Returns a date from an object.
-
Method Details
-
formatTime
Formats the time of a date resolved form the object. See getDate.- Parameters:
value
- the node can hold a number (milliseconds that have elapsed since midnight, January 1, 1970 ) or string formatted using the pattern yyyy-MM-dd'T'HH:mm:ss.SSSZ or yyyy-MM-dd- Returns:
- the date formatted using the pattern h:mm a.
-
formatDate
Formats the date of a date resolved form the object. See getDate.- Parameters:
value
- the node can hold a number (milliseconds that have elapsed since midnight, January 1, 1970 ) or string formatted using the pattern yyyy-MM-dd'T'HH:mm:ss.SSSZ or yyyy-MM-dd- Returns:
- the date formatted using the pattern dd/MMM/yy.
-
formatDay
Formats the day of a date resolved form the object. See getDate.- Parameters:
value
- the node can hold a number (milliseconds that have elapsed since midnight, January 1, 1970 ) or string formatted using the pattern yyyy-MM-dd'T'HH:mm:ss.SSSZ or yyyy-MM-dd- Returns:
- the date formatted using the pattern EEEE h:mm a.
-
formatDateTime
Formats the datetime of a date resolved form the object. See getDate.- Parameters:
value
- the node can hold a number (milliseconds that have elapsed since midnight, January 1, 1970 ) or string formatted using the pattern yyyy-MM-dd'T'HH:mm:ss.SSSZ or yyyy-MM-dd- Returns:
- the date formatted using the pattern dd/MMM/yy h:mm a.
-
format
Formats a date form the object using the provided pattern. See getDate.- Parameters:
value
- the node can hold a number (milliseconds that have elapsed since midnight, January 1, 1970 ) or string formatted using the pattern yyyy-MM-dd'T'HH:mm:ss.SSSZ or yyyy-MM-ddpattern
- the pattern- Returns:
- the date formatted using the provided pattern.
-
getDate
Returns a date from an object. The object could be a date, a number, a string or a json node with a string or a number.- Parameters:
value
- a date, string, number or a json node containing a number or a string.- Returns:
- a date or null if the date could not be resolved.
-