viewToModelValue method
Returns the value that must be supplied to the control.
Converts value from UI data type to control data type.
Implementation
@override
DateTimeRange? viewToModelValue(String? viewValue) {
final dateRange = viewValue?.trim().split(delimiter);
return dateRange == null || dateRange.isEmpty
? null
: DateTimeRange(
start: dateTimeFormat.parse(dateRange.first),
end: dateTimeFormat.parse(dateRange.last));
}