formatMY method

String formatMY([
  1. bool fullMonth = true
])

Formats this date as "Month Year".

If fullMonth is true, the full month name is used. Otherwise, the abbreviated month name is used.

Examples:

  • Jan 2025
  • January 2025

Implementation

String formatMY([bool fullMonth = true]) {
  return format(pattern: "MMM${fullMonth ? "M" : ""} yyyy");
}