mirror of
https://gitee.com/jmix/cuba.git
synced 2024-12-04 20:28:00 +08:00
Problems in working calendar. #PL-2649
This commit is contained in:
parent
aa54ce1b9a
commit
5598d8c4a2
@ -22,6 +22,7 @@ import org.apache.commons.lang.StringUtils;
|
|||||||
import org.apache.commons.logging.Log;
|
import org.apache.commons.logging.Log;
|
||||||
import org.apache.commons.logging.LogFactory;
|
import org.apache.commons.logging.LogFactory;
|
||||||
|
|
||||||
|
import java.sql.Time;
|
||||||
import java.text.ParseException;
|
import java.text.ParseException;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
@ -78,7 +79,10 @@ public class WebTimeField extends WebAbstractField<CubaMaskedTextField> implemen
|
|||||||
Date date = sdf.parse(formattedValue);
|
Date date = sdf.parse(formattedValue);
|
||||||
if (component.getComponentError() != null)
|
if (component.getComponentError() != null)
|
||||||
component.setComponentError(null);
|
component.setComponentError(null);
|
||||||
return date;
|
if (targetType == java.sql.Time.class) {
|
||||||
|
return new Time(date.getTime());
|
||||||
|
} else
|
||||||
|
return date;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.debug("Unable to parse value of component " + getId() + "\n" + e.getMessage());
|
log.debug("Unable to parse value of component " + getId() + "\n" + e.getMessage());
|
||||||
throw new ConversionException("Invalid value");
|
throw new ConversionException("Invalid value");
|
||||||
|
Loading…
Reference in New Issue
Block a user