Re: Velocity EOGenerator Date In Templates

From: Michael Hast (mhas..esertsky.com)
Date: Wed Mar 12 2008 - 21:16:22 EDT

  • Next message: Michael Hast: "WO Package View Sorting"

    Hi everyone:

    Should I file an enhancement feature for this or has this been integrated?

    Michael.

    Michael Hast wrote:
    > I see, so there was no "date" in the eogen template context. Ok, as far
    > as I can tell from the Velocity documentation, I would suggest to use
    > the Velocity DateTool object to format dates. They suggest to use $date
    > as the variable.
    >
    > Example of formatting the "current" date:
    > $date -> Oct 19, 2003 9:54:50 PM
    > $date.long -> October 19, 2003 9:54:50 PM PDT
    > $date.medium_time -> 9:54:50 PM
    > $date.full_date -> Sunday, October 19, 2003
    > $date.get('default','short') -> Oct 19, 2003 9:54 PM
    > $date.get('yyyy-M-d H:m:s') -> 2003-10-19 21:54:50
    >
    > Links I found for DateTool:
    > http://www.jajakarta.org/velocity/tools/velocity-tools-1.1/docs/generic/DateTool.html
    >
    > http://velocity.apache.org/tools/releases/1.3/javadoc/org/apache/velocity/tools/generic/DateTool.html
    >
    > http://www.java2s.com/Code/Java/Velocity/HowtouseDateinVelocity.htm
    >
    > Michael.
    >
    > Mike Schrag wrote:
    >> I have committed a new "date" (new Date()) and "calendar"
    >> (Calendar.getInstance()) binding into the eogen template context. Not
    >> sure how to format that in velocity, though.
    >>
    >> ms
    >>
    >> On Mar 6, 2008, at 9:55 PM, Michael Hast wrote:
    >>
    >>> Hi:
    >>>
    >>> The old EOGenerator templates had the ability of displaying date
    >>> information in different formats, e.g. "<$date %a %b %d %Y$>" or
    >>> "<$date %Y$>" just for the year. How would I do that in the new
    >>> Velocity templates? It seems that the context needs to have a date
    >>> variable passed in. Is that something that can be done?



    This archive was generated by hypermail 2.0.0 : Wed Mar 12 2008 - 21:18:16 EDT