Actually it was wrong in 2.0.x, on 2.1 the date will always be submitted as RFC 3339, if you define your field as a Date, or a Calendar object you won't have to do any conversion at all.
musachy On Nov 14, 2007 5:24 AM, Giovanni Azua <[EMAIL PROTECTED]> wrote: > hi, > > In version 2.0.9 I had a datetimepicker with custom user-defined > conversion that worked fine. After migrating > to S 2.1.1 my conversion class on submit receives the beginDate in the > wrong format, instead of the expected > "yyyy.MM.dd" I get something like dd-MM-yyyyT<time part>. > > Seems like a defect new to 2.1.1 or? > > Thanks in advance, > Best regards, > Giovanni > > ****************************** formSimulationRun.jsp ********************* > > <%@ page contentType="text/html; charset=UTF-8"%> > <%@ taglib prefix="s" uri="/struts-tags"%> > <%@ taglib prefix="sx" uri="/struts-dojo-tags" %> > > <s:form action="SimulationRun.action" method="post" theme="%{currentTheme}"> > <sx:datetimepicker label="Begin Date" name="beginDate" > displayFormat="yyyy.MM.dd" toggleType="fade" > toggleDuration="500" /> > ... > <s:submit value="Simulate" align="center"/> > </s:form> > > *********************** SimulationRunAction-conversion.properties > *********************** > > beginDate=com.sag.optimizer.ui.web.support.StringToDateConverter > endDate=com.sag.optimizer.ui.web.support.StringToDateConverter > > *********************** StringToDateConverter.java > ************************************ > > /** > * Custom conversion used by e.g. Simulation input form. > * > * @author <a href="mailto:[EMAIL PROTECTED]">Giovanni Azua</a> > * @version $ $Date: Oct 3, 2007 1:27:13 PM $ > */ > public > class StringToDateConverter > extends StrutsTypeConverter > { > > //------------------------------------------------------------------------ > // public > > //------------------------------------------------------------------------ > @Override > public Object > convertFromString(Map aMap, String[] anArguments, Class aClass) > { > if (anArguments.length != 1) > { > super.performFallbackConversion(aMap, anArguments, aClass); > } > Integer myDate = > Integer.valueOf(anArguments[0].replaceAll("\\.", "")); > > return myDate; > } > > > //------------------------------------------------------------------------ > /** > * @throws UnsupportedOperationException "Not yet implemented." > */ > @Override > public String > convertToString(Map aMap, Object anArgument) > { > throws UnsupportedOperationException("Not yet implemented."); > } > } > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -- "Hey you! Would you help me to carry the stone?" Pink Floyd --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]