Function getBanglaCalendarMonth

  • Converts a month to its Bangla calendar month name.

    Parameters

    • month: string | number

      The month as a number (1-12), full month name (e.g., "Boishakh"), or short name (e.g., "Boi").

    • strict: boolean = true

      If true, throws errors for invalid inputs. If false, returns an empty string.

    Returns string

    The Bangla calendar month name or an empty string if invalid and strict is false.

    If the input is invalid and strict is true.

    getBanglaCalendarMonth(1); // "বৈশাখ"
    getBanglaCalendarMonth("Boishakh"); // "বৈশাখ"
    getBanglaCalendarMonth("boi"); // "বৈশাখ"
    getBanglaCalendarMonth("BOI"); // "বৈশাখ"
    getBanglaCalendarMonth(13); // Throws an error (invalid month)
    getBanglaCalendarMonth(13, false); // ""