Files
RasadDam_Frontend/src/utils/getPersianMonths.ts
2026-01-19 13:08:58 +03:30

25 lines
501 B
TypeScript

export function getPersianMonths(monthNumbers?: number[] | null): string[] {
const persianMonths: { [key: number]: string } = {
1: "فروردین",
2: "اردیبهشت",
3: "خرداد",
4: "تیر",
5: "مرداد",
6: "شهریور",
7: "مهر",
8: "آبان",
9: "آذر",
10: "دی",
11: "بهمن",
12: "اسفند",
};
if (!monthNumbers) {
return [];
}
return monthNumbers?.map((num) => {
return persianMonths[num];
});
}