first project version mrDecor

This commit is contained in:
alirez.br
2026-05-11 15:30:57 +03:30
commit 8724072983
302 changed files with 25401 additions and 0 deletions
+15
View File
@@ -0,0 +1,15 @@
import { format, newDate } from "date-fns-jalali";
import { faIR } from "date-fns-jalali/locale";
/**
* Format a Gregorian date (Date or ISO string) to Shamsi (Jalali) Persian string.
* Example: "۱۴ بهمن ۱۴۰۴"
*/
export function formatDateShamsi(
date: Date | string,
formatStr: string = "d MMMM yyyy"
): string {
const d = typeof date === "string" ? new Date(date) : date;
if (Number.isNaN(d.getTime())) return "";
return format(d, formatStr, { locale: faIR });
}