monthNameToNumber method

int monthNameToNumber(
  1. String label
)

Converts a month abbreviation (e.g., 'JAN') to its numerical value (e.g., 1).

Implementation

int monthNameToNumber(String label) {
  const months = [
    'JAN',
    'FEB',
    'MAR',
    'APR',
    'MAY',
    'JUN',
    'JUL',
    'AUG',
    'SEP',
    'OCT',
    'NOV',
    'DEC',
  ];
  return months.indexOf(label) + 1;
}