getLocaleFullMonthFormat function

DateFormat getLocaleFullMonthFormat(
  1. Locale locale
)

Get full month format for the given locale.

Implementation

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

  return monthFormat;
}