Skip to content
Snippets Groups Projects
Verified Commit bedd1caa authored by Timm Fitschen's avatar Timm Fitschen
Browse files

FIX #183

parent 45cf506d
No related branches found
No related tags found
2 merge requests!41REL: update changelog, bump version of pom.xml, update DEPENDENCIES,!37FIX #183
Pipeline #14316 passed
......@@ -37,12 +37,19 @@ public class DateTimeDatatype extends AbstractDatatype {
try {
if (value instanceof UTCDateTime || value instanceof Date) {
return (DateTimeInterface) value;
} else if (value instanceof GenericValue) {
return DateTimeFactory2.valueOf(((GenericValue) value).toDatabaseString());
}
DateTimeInterface result;
if (value instanceof GenericValue) {
result = DateTimeFactory2.valueOf(((GenericValue) value).toDatabaseString());
} else {
return DateTimeFactory2.valueOf(value.toString());
result = DateTimeFactory2.valueOf(value.toString());
}
} catch (final IllegalArgumentException e) {
// Test if this is storable
result.toDatabaseString();
return result;
} catch (final UnsupportedOperationException | IllegalArgumentException e) {
throw ServerMessages.CANNOT_PARSE_DATETIME_VALUE;
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment