Interface ITemplateDateFormatter


public interface ITemplateDateFormatter
Bean that allows user to render dates in templates.

The date formatter/parsers will use the configured Timezone.

  • Method Details

    • formatTime

      String formatTime(Object value)
      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

      String formatDate(Object value)
      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

      String formatDay(Object value)
      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

      String formatDateTime(Object value)
      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

      String format(Object value, String pattern)
      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-dd
      pattern - the pattern
      Returns:
      the date formatted using the provided pattern.
    • getDate

      Date getDate(Object value)
      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.