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.

Good luck,

Chris

> -----Original Message-----
> From: Zidarics Zoltan [mailto:[EMAIL PROTECTED]
> Sent: Monday, March 24, 2003 5:34 AM
> To: Turbine Users List
> Subject: intake datevalidator
>
>
> Hi All,
>
> Can I repeat my question, because it seems to be weekend is holiday. :-)
>
> How can I set locale specific date format in intake?
> I use
> - Turbine 2.2.1 with
> - java version "1.3.0"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0)
> Classic VM (build 1.3.0, J2RE 1.3.0 IBM build cx130-20010925 (JIT
> enabled:
> jitc))
> in Debian Linux 3.0 unstable.
>
> Locale is set hu,HU but DateStringValidator of intake used a
> SimpleDateFormat
> with m/d/y format.
>
> There are locale specific setting in  TR.properties:
> locale.default.language=hu
> locale.default.country=HU
>
> Are there any methods to set locale specific attributes of
> DateStringValidator?
> --
> udv,
> ----------------------------------------------------
> 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