parseDateTimeFromInlineList function

List<DateTime>? parseDateTimeFromInlineList(
  1. Object? o, [
  2. Pattern delimiter = ',',
  3. List<DateTime>? def
])

Converts o to a List<DateTime>.

Implementation

List<DateTime>? parseDateTimeFromInlineList(Object? o,
    [Pattern delimiter = ',', List<DateTime>? def]) {
  if (o == null) return def;
  if (o is DateTime) return [o];
  if (o is List) {
    return o.map((e) => parseDateTime(e)).toList() as List<DateTime>?;
  }
  return parseFromInlineList(o.toString(), delimiter,
      parseDateTime as DateTime Function(String)?, def);
}