Class FormatDateTag

  • All Implemented Interfaces:
    javax.servlet.jsp.tagext.JspTag, javax.servlet.jsp.tagext.SimpleTag

    public class FormatDateTag
    extends javax.servlet.jsp.tagext.SimpleTagSupport
    Format a date or calendar object as a date and/or time string using the user's locale to determine the formatting style and time zone. This tag should be used instead of the standard fmt:formatDate tag.
    value
    The date or calendar object to format. It should be in WebManager's internal time zone. Required
    var
    The variable to place the result in if set, otherwise the result is simply printed. Optional.
    type
    Determines what to print, date, time or both. The value of this is one of 'date', 'time' or 'both'. Optional, defaults to 'date'.
    applyTimeZone
    Sets whether the date and time should be adjusted to the user's time zone. Optional, defaults to true.
    • Constructor Detail

      • FormatDateTag

        public FormatDateTag()
    • Method Detail

      • setValue

        public void setValue​(Object value)
        Sets the date which will be used by this tag.
        Parameters:
        value - the date to be localized
      • getValue

        public Object getValue()
        Returns the date which will be used by this tag.
        Returns:
        the date which will be used by this tag.
      • getVar

        public String getVar()
        Returns the identifier under which the localized datetime should be stored in the pageContext .
        Returns:
        the name of the optional entry in the pageContext under which the localized datetime should be stored.
      • setVar

        public void setVar​(String var)
        Sets the identifier of the optional entry in the pageContext under which the localized datetime should be stored.
        Parameters:
        var - the name of the identifier
      • getType

        public String getType()
        Get the formatting type.
        Returns:
        The type if set otherwise null.
      • setType

        public void setType​(String type)
        Set the format type.
        Parameters:
        type - Should be one of 'date', 'time' or 'both'.
      • getApplyTimeZone

        public Boolean getApplyTimeZone()
        Get whether time zone adjustments should be applied.
        Returns:
        True means adjust for time zone.
      • setApplyTimeZone

        public void setApplyTimeZone​(Boolean applyTimeZone)
        Set whether time zone adjustments should be applied.
        Parameters:
        applyTimeZone - True means adjust for time zone.
      • doTag

        public void doTag()
                   throws javax.servlet.jsp.JspException
        Specified by:
        doTag in interface javax.servlet.jsp.tagext.SimpleTag
        Overrides:
        doTag in class javax.servlet.jsp.tagext.SimpleTagSupport
        Throws:
        javax.servlet.jsp.JspException