mirror of
https://gitee.com/jmix/cuba.git
synced 2024-12-05 04:38:10 +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,6 +79,9 @@ 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);
|
||||||
|
if (targetType == java.sql.Time.class) {
|
||||||
|
return new Time(date.getTime());
|
||||||
|
} else
|
||||||
return date;
|
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());
|
||||||
|
Loading…
Reference in New Issue
Block a user