Re: Velocity DateTool Coding Examples

2004-10-28 Thread Mike Kienenberger
John Reynolds <[EMAIL PROTECTED]> wrote: > Hi Mike, thanks for the quick reply! > > Here is where i think all those beers from college are taking a toll =) > > ==> assumes your DateTool is named "date" <== > > Can in instantiate the tool from within the template? right now i am not > putting the

Re: Velocity DateTool Coding Examples

2004-10-28 Thread Mike Kienenberger
John Reynolds <[EMAIL PROTECTED]> wrote: > What I can_t crack is how to use the Date tool IN THE TEMPLATE to format > the string. Any help is appreciated. Here's one example in macro format (assumes your DateTool is named "date"): #macro (formattedDateTime $dateValue)${date.format("h:mm a M d

RE: Velocity DateTool Coding Examples

2004-10-28 Thread John Reynolds
Hi John, I was glad to see this recently discussed on the list. I believe i have all the puzzle pieces but i'm having trouble fitting them together. Let me simplify my application with an example. Using struts and JSP, the struts action retrieves a list of Birthday objects, where Birthday.java i

Re: Velocity DateTool Coding Examples--OK

2004-10-25 Thread Shinobu Kawai
Hi John, > I discovered that the DateTool code needed to be included into a #Set(). > In case another newbie is as retarded as I am here's the code I used: > > #set ($priorDate = $shoppingCartItem.priorDate) ## prior Cart Date > #set ($datePick = $date.format('M/d/',$priorDate)) ## Cart Date

Re: Velocity DateTool Coding Examples--OK

2004-10-25 Thread john mahan
- Original Message - From: "Shinobu Kawai" <[EMAIL PROTECTED]> To: "Velocity Users List" <[EMAIL PROTECTED]> Sent: Saturday, October 23, 2004 9:41 AM Subject: Re: Velocity DateTool Coding Examples > hi john, > > > I'm a Velocity newbie and have no

Re: Velocity DateTool Coding Examples

2004-10-23 Thread Shinobu Kawai
hi john, > I'm a Velocity newbie and have not been able to use the DateTool properly. I > understand the methods but have not been successful coding them so they render > properly in the Template. Need to convert a Date object to a string DD/MM/ for > display and convert a String object DD/

RE: Velocity DateTool Coding Examples

2004-10-23 Thread chenjian
I haven't used the DateTool. I have my own Formatter class that formats date as well as other stuff. A code snippet is as follows: import java.text.SimpleDateFormat; //format a date object to dd/MM/ date string java.util.Date value = new Date(); SimpleDateFormat sdf = new SimpleDateFormat("d

Velocity DateTool Coding Examples

2004-10-23 Thread john mahan
I'm a Velocity newbie and have not been able to use the DateTool properly. I understand the methods but have not been successful coding them so they render properly in the Template. Need to convert a Date object to a string DD/MM/ for display and convert a String object DD/MM/ to Date ob