generateDateFormat static method

String generateDateFormat(
  1. String dateFormat,
  2. DateTimePickerMode pickerMode
)

Get default value of date format.

Implementation

static String generateDateFormat(
    String dateFormat, DateTimePickerMode pickerMode) {
  if (dateFormat.length > 0) {
    return dateFormat;
  }
  switch (pickerMode) {
    case DateTimePickerMode.date:
      return DATETIME_PICKER_DATE_FORMAT;
    case DateTimePickerMode.datetime:
      return DATETIME_PICKER_DATETIME_FORMAT;
  }
}