first commit
This commit is contained in:
24
src/utils/getPersianMonths.ts
Normal file
24
src/utils/getPersianMonths.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
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];
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user