« Return to Thread: t:inputCalendar conversion problem

Re: t:inputCalendar conversion problem

by Nitin Deshmukh :: Rate this Message:

Reply to Author | View in Thread

I had the same problem. I did the following in my action method before using the date.

if (start_date != null) {
        GregorianCalendar cal = new GregorianCalendar();
        cal.setTime(start_date);
        int year = cal.get(Calendar.YEAR);
        if (year < 100) {
                cal.set(Calendar.YEAR, year + 2000);
                start_date = cal.getTime();
        }
}


It works well for me. You can try it too.

Nitin

--- On Wed, 5/14/08, rcandersonmn <randerson@...> wrote:

> From: rcandersonmn <randerson@...>
> Subject: t:inputCalendar conversion problem
> To: users@...
> Date: Wednesday, May 14, 2008, 1:52 PM
> I'm having a problem with the way t:inputCalendar
> converts a date entered by
> a user -- not from the popup.  If the user enters 1/1/08,
> the conversion is
> 01/01/0008.
>
> Any ideas on how to make it be 2008 instead of 0008.
>
> Thanks for your help
>
>
> --
> View this message in context:
> http://www.nabble.com/t%3AinputCalendar-conversion-problem-tp17237157p17237157.html
> Sent from the MyFaces - Users mailing list archive at
> Nabble.com.


     

 « Return to Thread: t:inputCalendar conversion problem

LightInTheBox - Buy quality products at wholesale price