getLocaleShortMonthFormat function

DateFormat getLocaleShortMonthFormat(
  1. Locale locale
)

Get short month format for the given locale.

Implementation

DateFormat getLocaleShortMonthFormat(Locale locale) {
  final String localeName = Intl.canonicalizedLocale(locale.toString());
  var monthFormat = DateFormat.MMM();
  if (DateFormat.localeExists(localeName)) {
    monthFormat = DateFormat.MMM(localeName);
  } else if (DateFormat.localeExists(locale.languageCode)) {
    monthFormat = DateFormat.MMM(locale.languageCode);
  }

  return monthFormat;
}