getMonthName function

String getMonthName(
  1. int month
)

Name calculation functions for Hindu calendar

This file contains functions to calculate names for various Hindu calendar elements like months, tithis, nakshatras, etc. Gets the name of the month

Implementation

/// Gets the name of the month
String getMonthName(int month) {
  const List<String> monthNames = [
    'Caitra',
    'Vaisakha',
    'Jyaistha',
    'Asadha',
    'Sravana',
    'Bhadrapada',
    'Asvina',
    'Kartika',
    'Margasirsa',
    'Pausa',
    'Magha',
    'Phalguna',
  ];

  if (month >= 1 && month <= 12) {
    return monthNames[month - 1];
  }
  return 'Unknown';
}