timeSpanUnitOf function
Implementation
TimeSpanUnit? timeSpanUnitOf(input) {
if (input is TimeSpanUnit) return input;
final lc = "$input".toLowerCase().trimEnd("s");
return TimeSpanUnit.values
.where((unit) => unit.name == lc)
.firstWhereOrNull((element) => true);
}