toDuration static method
Converts value into Date or returns current date when conversion is not possible.
value
the value to convert. Returns Date value or current date when conversion is not supported.
Implementation
static Duration toDuration(value) {
return DurationConverter.toDurationWithDefault(value, Duration());
}