Hi,

> We validate dates manually when using T2.2.  To do this, we:
>
> 1. Write an Intake adaptor method for the get/set date field methods in the
> target class:
>       public class Order
>       {
>       ...
>               /* Torque-generated object class field */
>               public Date getDate()
>               {
>                       return this.date;
>               }
>
>               /* Torque-generated object class field */
>               public void setDate(Date arg)
>               {
>                       this.date = arg;
>               }
>
>
>               public String getIntakeDate()
>               {
>                       SimpleDateFormat formatter = new SimplateDateFormat("Your 
> Format");
>                       return formatter.format(getDate);
>               }
>
>               public void setIntakeDate(String arg)
>                       throws ParseException
>               {
>                       DateFormat parser = new DateFormat();
>                       setDate(parser.parse(arg));
>               }
>       }
>
> 2. Set our intake.xml field to "IntakeDate", type "String".  Also set a
> regexp mask rule for the pattern of your date format.
>
> 3. Of course, use the IntakeDate method in templates.
>
> This isn't the most elegant solution, and it will be great when Intake is
> more flexible with dates (in fact it might already be in the T2.3 CVS
> HEAD), but it seems to work well for us.

Great idea! Thank you for it.
-- 
thx,
----------------------------------------------------
Zoltan Zidarics programmer
PTE University Pecs, Hungary
icq: 43288694


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to