getMonthAbbrev function

String getMonthAbbrev(
  1. int month
)

Returns the three-letter abbreviation for the given month number.

Implementation

String getMonthAbbrev(int month) {
  const monthAbbrevs = [
    'Jan',
    'Feb',
    'Mar',
    'Apr',
    'May',
    'Jun',
    'Jul',
    'Aug',
    'Sep',
    'Oct',
    'Nov',
    'Dec'
  ];
  return monthAbbrevs[month - 1];
}