hi...

i've created a string to time Conversion:

public Object convertValue(Map ctx, Object value, Class toType) {

                if(toType==String.class){
                        return convert((Date) value);
                }
                if(toType==Date.class){
                        String s=((String[])value)[0];
                        return  convert(s);
                }
                return null;
        }
        protected Date convert(String v) {
                final Calendar calendar=new GregorianCalendar();
                if (v.indexOf(':')>0){
                        calendar.set(Calendar.HOUR_OF_DAY,new 
Integer(v.split(":")[0]));
                        calendar.set(Calendar.MINUTE,new 
Integer(v.split(":")[1]));
                        return calendar.getTime();
                }
                return null;
        }

        protected String convert(Date value){
                final Calendar calendar=new GregorianCalendar();
                calendar.setTime( value==null ? new Date(): value);
String s=calendar.get(Calendar.HOUR_OF_DAY)+ ":"+calendar.get(Calendar.MINUTE);
                return s;
        }

i linked it a spefici field in the properties files of an action (reportHours-conversion.properties) the problem begins when i define properties in Date type in the action, the convertor sends the string correctly to the Time Picker which DOESN'T display it, if i try typeing the same time, and move to the next field the values i clicked vanishes, BUT if i choose the same value from time picker's drop down, it's ok... should i loose the time picker completly??

_________________________________________________________________
FREE pop-up blocking with the new MSN Toolbar - get it now! http://toolbar.msn.click-url.com/go/onm00200415ave/direct/01/


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to