Fix [ 1950305 ] Can't define default for Time fields
This commit is contained in:
parent
96dd2d3f66
commit
3e591b9194
|
@ -639,7 +639,13 @@ public class GridField
|
|||
// Timestamps
|
||||
if (DisplayType.isDate(m_vo.displayType))
|
||||
{
|
||||
java.util.Date date = DisplayType.getDateFormat_JDBC().parse (value);
|
||||
// try timestamp format - then date format -- [ 1950305 ]
|
||||
java.util.Date date = null;
|
||||
try {
|
||||
date = DisplayType.getTimestampFormat_Default().parse (value);
|
||||
} catch (java.text.ParseException e) {
|
||||
date = DisplayType.getDateFormat_JDBC().parse (value);
|
||||
}
|
||||
return new Timestamp (date.getTime());
|
||||
}
|
||||
|
||||
|
|
|
@ -350,6 +350,15 @@ public final class DisplayType
|
|||
return new SimpleDateFormat ("yyyy-MM-dd");
|
||||
} // getDateFormat_JDBC
|
||||
|
||||
/**
|
||||
* JDBC Timestamp Format yyyy-mm-dd hh:mm:ss
|
||||
* @return timestamp format
|
||||
*/
|
||||
static public SimpleDateFormat getTimestampFormat_Default()
|
||||
{
|
||||
return new SimpleDateFormat ("yyyy-MM-dd HH:mm:ss");
|
||||
} // getTimestampFormat_JDBC
|
||||
|
||||
/**
|
||||
* Return Storage Class.
|
||||
* (used for MiniTable)
|
||||
|
|
Loading…
Reference in New Issue