Log when a date property is set and date parsing fails
This commit is contained in:
parent
33f89d80a0
commit
a129191e19
1 changed files with 2 additions and 1 deletions
|
@ -145,13 +145,14 @@ public final class Property implements IProperty, Serializable, Cloneable {
|
|||
dirty = true;
|
||||
// if this is not a string property, try to parse a value out of it
|
||||
if (type == DATE) {
|
||||
SimpleDateFormat dateformat = new SimpleDateFormat ();
|
||||
try {
|
||||
SimpleDateFormat dateformat = new SimpleDateFormat ();
|
||||
dateformat.setLenient (true);
|
||||
Date date = dateformat.parse (value);
|
||||
this.lvalue = date.getTime ();
|
||||
return;
|
||||
} catch (ParseException nodate) {
|
||||
IServer.getLogger().log ("Couldn't parse date: was expecting something like "+dateformat.format (new Date()));
|
||||
// store as plain string
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue