You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by rcandersonmn <ra...@archwing.com> on 2008/05/14 19:52:01 UTC

t:inputCalendar conversion problem

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

Posted by Hazem Saleh <ha...@gmail.com>.
Could you please send us your code ?
Thanks!

On Wed, May 14, 2008 at 8:52 PM, rcandersonmn <ra...@archwing.com>
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

Posted by Hazem Saleh <ha...@gmail.com>.
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 <ra...@archwing.com>
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

Re: t:inputCalendar conversion problem

Posted by rcandersonmn <ra...@archwing.com>.
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.


Re: t:inputCalendar conversion problem

Posted by Nitin Deshmukh <de...@yahoo.com>.
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 <ra...@archwing.com> wrote:

> From: rcandersonmn <ra...@archwing.com>
> Subject: t:inputCalendar conversion problem
> To: users@myfaces.apache.org
> 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.