public Object convert(Class type, Object value) throws ConversionException {
if (value == null)
return Duration.getInstanceFromDouble(null);
if (value instanceof Number) {
return new Work(((Number)value).longValue());
} else if (value instanceof Work) {
return new Work(((Work)value).longValue());
} else if (value instanceof Duration) {
return value;
} else if (value instanceof String) {
try {
return DurationFormat.getWorkInstance().parseObject((String) value);