getLocaleMonths static method

List<String>? getLocaleMonths(
  1. DateTimePickerLocale locale, [
  2. bool isFull = true
])

Get locale month array

Implementation

static List<String>? getLocaleMonths(DateTimePickerLocale locale,
    [bool isFull = true]) {
  _StringsI18n i18n = datePickerI18n[locale] ??
      datePickerI18n[dateTimePickerLocaleDefault]!;

  if (isFull) {
    List<String> months = i18n.getMonths();
    return months;
  }

  List<String>? months = i18n.getMonthsShort();
  if (months != null && months.isNotEmpty && months.length == 12) {
    return months;
  }
  return i18n.getMonthsShort();
}