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;
|
dirty = true;
|
||||||
// if this is not a string property, try to parse a value out of it
|
// if this is not a string property, try to parse a value out of it
|
||||||
if (type == DATE) {
|
if (type == DATE) {
|
||||||
try {
|
|
||||||
SimpleDateFormat dateformat = new SimpleDateFormat ();
|
SimpleDateFormat dateformat = new SimpleDateFormat ();
|
||||||
|
try {
|
||||||
dateformat.setLenient (true);
|
dateformat.setLenient (true);
|
||||||
Date date = dateformat.parse (value);
|
Date date = dateformat.parse (value);
|
||||||
this.lvalue = date.getTime ();
|
this.lvalue = date.getTime ();
|
||||||
return;
|
return;
|
||||||
} catch (ParseException nodate) {
|
} catch (ParseException nodate) {
|
||||||
|
IServer.getLogger().log ("Couldn't parse date: was expecting something like "+dateformat.format (new Date()));
|
||||||
// store as plain string
|
// store as plain string
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue