monthNameLocalized method

String monthNameLocalized([
  1. Locale? locale
])

Gets the month name in a specific locale.

Example:

final date = DateTime(2024, 1, 15); // January
print(date.monthNameLocalized(const Locale('en'))); // Output: "January"
print(date.monthNameLocalized(const Locale('fr'))); // Output: "janvier"
print(date.monthNameLocalized(const Locale('es'))); // Output: "enero"

Implementation

String monthNameLocalized([Locale? locale]) =>
    _formatLocalized(() => DateFormat.MMMM(locale?.toLanguageTag()), this, locale);