months static method
- string? locale
Returns a list of month names.
The locale
parameter is optional and can be used to specify the locale for formatting the month names.
If no locale
is provided, the default locale will be used.
Example:
List<String> months = months();
print(months); // Output: [January, February, March, April, May, June, July, August, September, October, November, December]
Implementation
static List<string> months([string? locale]) => [for (var i = 1; i <= 12; i++) DateFormat.MMMM(locale).format(DateTime(thisYear, i, 1))];