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.
-
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.formatTimeZoneId(Object value, String pattern, String timeZoneId) Formats a date from the object using the provided pattern and time zone.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.
-
formatTimeZoneId
Formats a date from the object using the provided pattern and time zone. 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 patterntimeZoneId- the time zone id to use when formatting the date, using format of {AREA}/{LOCATION} (e.g. Europe/London), see the following for all available time Zones: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones- Returns:
- the date formatted using the provided pattern and time zone.
-
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.
-