month static method

string month(
  1. int month, [
  2. string? locale
])

Returns the name of the month corresponding to the given month number.

The month parameter represents the month number, ranging from 1 to 12. If the locale parameter is provided, the month name will be returned based on the specified locale.

Example:

String monthName = month(3);
print(monthName); // Output: "March"

Note: The locale parameter is optional. If not provided, the default locale will be used.

Implementation

static string month(int month, [string? locale]) => months(locale)[month.clampRotate(1, 12) - 1];