You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by Creto <cr...@hotmail.com> on 2011/09/01 05:30:59 UTC

Working with POJO with a calendar field

Hi,
  I would like to get some hints, about working with java.util.Calendar.

Let’s say I have an object like this:

Public class Subscriber {
   Private String name;
   Private Calendar birthday;
}

I would like to use this field in a template, without having to go through a
DateTool kinda thing. By that I mean, instead of having to pass a DateTool
in my context, then in my template use it with something like
$myDateTool.format(‘yyyy-MM-dd’, $subscriber.birthday), I would like to use
something shorter, like $subscriber.birthday, and get it formatted
automatically to something humanly readable. Is this possible? Can I
register a class somewhere telling Velocity that if he needs to handle a
java.util.Calendar, format it a certain way?

Thank you in advance

Jean-Francois Croteau

-- 
View this message in context: http://old.nabble.com/Working-with-POJO-with-a-calendar-field-tp32377112p32377112.html
Sent from the Velocity - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
For additional commands, e-mail: user-help@velocity.apache.org