setValidDateTime static method

String setValidDateTime({
  1. required String fromDateTime,
  2. required String toDateTime,
  3. String format = Format.fyyyyMMdd,
})

set valid date from valid date range

Implementation

static String setValidDateTime(
    {required String fromDateTime,
    required String toDateTime,
    String format = Format.fyyyyMMdd}) {
  if (validDateTimeRange(
      fromDateTime: fromDateTime, toDateTime: toDateTime, format: format)) {
    return toDateTime;
  } else {
    return fromDateTime;
  }
}