diff --git a/src/app/home/page.jsx b/src/app/home/page.jsx index 2a32174..aef44ca 100644 --- a/src/app/home/page.jsx +++ b/src/app/home/page.jsx @@ -15,6 +15,7 @@ import { Doughnut, Pie } from "react-chartjs-2"; import BottomSheetChangeRole from "plugins/BottomSheet/BottomSheetChangeRole"; import HasPermission from "plugins/HasPermission/page"; import Avatar from "boring-avatars"; +import moment from "jalali-moment"; ChartJS.register(ArcElement, Tooltip, Legend); @@ -25,16 +26,6 @@ const Home = (props) => { const profile = CTX.state.profile; - // useEffect(() => { - // if (!HasPermission("ViewDashboard")) { - // // You can customize the redirect path as needed - // router.replace("/activity"); - // return null; // Prevent rendering the rest of the component - - // ); - // } - // }, [profile]); - console.log(profile); useEffect(() => { @@ -81,12 +72,25 @@ const Home = (props) => { CTX.setBottomSheetReportOpen(true); }; - console.log( - new Intl.DateTimeFormat("fa-IR-u-nu-latn", { - dateStyle: "full", - timeStyle: "long", - }).format(new Date()) - ); + const formatJalaliDate = (date) => { + const jalaliDateDay = moment(date).locale("fa").format("jD"); + const jalaliDateYear = moment(date).locale("fa").format("jYYYY"); + + // Extract day name + const dayName = moment(date).locale("fa").format("dddd"); + + // Map English day names to Persian + + // Get the Persian day name + + // Extract month name + const monthName = moment(date).locale("fa").format("jMMMM"); + + return `${dayName} ${jalaliDateDay} ${monthName} ${jalaliDateYear}`; + }; + + const today = new Date(); + const formattedDate = formatJalaliDate(today); return (
@@ -144,7 +148,9 @@ const Home = (props) => {
)}
-

شنبه 20 فروردین 1403

+

+ +