import { differenceInMinutes, format } from 'date-fns';
import { isDateValid } from '.';
export function formatDatesForInput(startDate, endDate, datePickerFormat) {
  if (isDateValid(startDate) && isDateValid(endDate) && differenceInMinutes(endDate, startDate) > 0) {
    return "".concat(format(startDate, datePickerFormat), " - ").concat(format(endDate, datePickerFormat));
  }
  if (isDateValid(startDate)) {
    return format(startDate, datePickerFormat);
  }
  return '';
}