t:inputCalendar conversion problem

View: New views
5 Messages — Rating Filter:   Alert me  

t:inputCalendar conversion problem

by rcandersonmn :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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


Re: t:inputCalendar conversion problem

by Hazem Saleh :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Could you please send us your code ?
Thanks!

On Wed, May 14, 2008 at 8:52 PM, rcandersonmn <randerson@...> wrote:

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.




--
Hazem Ahmed Saleh Ahmed
http://www.jroller.com/page/HazemBlog

Re: t:inputCalendar conversion problem

by Nitin Deshmukh :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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.


     

Re: t:inputCalendar conversion problem

by rcandersonmn :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Here is what I used.  

<t:inputCalendar id="dateComplete" monthYearRowClass="yearMonthHeader" weekRowClass="weekHeader"
    renderPopupButtonAsImage="true"  popupButtonStyleClass="standard_bold"
    currentDayCellClass="currentDayCell" value="#{rioGeneralScreensHandler.dateComplete}"
    renderAsPopup="true" popupDateFormat="MM/dd/yyyy"    
    displayValueOnly="#{!rioGeneralScreensHandler.editMode}"/>

Re: t:inputCalendar conversion problem

by Hazem Saleh :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

It works ok with me.
Can u send me your war file (I mean a custom version of the war that contains only the page and the Backing Bean) ?
Thanks!

On Thu, May 15, 2008 at 5:17 PM, rcandersonmn <randerson@...> wrote:

Here is what I used.

<t:inputCalendar id="dateComplete" monthYearRowClass="yearMonthHeader"
weekRowClass="weekHeader"
   renderPopupButtonAsImage="true"  popupButtonStyleClass="standard_bold"
   currentDayCellClass="currentDayCell"
value="#{rioGeneralScreensHandler.dateComplete}"
   renderAsPopup="true" popupDateFormat="MM/dd/yyyy"
   displayValueOnly="#{!rioGeneralScreensHandler.editMode}"/>

--
View this message in context: http://www.nabble.com/t%3AinputCalendar-conversion-problem-tp17237157p17254308.html
Sent from the MyFaces - Users mailing list archive at Nabble.com.




--
Hazem Ahmed Saleh Ahmed
http://www.jroller.com/page/HazemBlog