defaultDateFormat static method

DateFormatPreference defaultDateFormat([
  1. Locale? locale
])

Implementation

static DateFormatPreference defaultDateFormat([Locale? locale]) {
  locale ??= PlatformDispatcher.instance.locale;
  if (locale.languageCode == 'de') return DateFormatPreference.german;
  if (locale.languageCode == 'en' && locale.countryCode == 'US') {
    return DateFormatPreference.us;
  }
  if (locale.languageCode == 'en' &&
      {'GB', 'AU', 'IE'}.contains(locale.countryCode)) {
    return DateFormatPreference.european;
  }
  return DateFormatPreference.iso;
}