diff --git a/app/payment/[uuid]/page.js b/app/payment/[uuid]/page.js index cf1c035..33b0cf4 100644 --- a/app/payment/[uuid]/page.js +++ b/app/payment/[uuid]/page.js @@ -99,6 +99,7 @@ export default function PaymentDetailsPage() { const formatDate = (timestamp) => { const date = new Date(parseInt(timestamp) * 1000); return new Intl.DateTimeFormat("fa-IR", { + timeZone: "Asia/Tehran", year: "numeric", month: "long", day: "numeric", diff --git a/components/appointment/information/Detail.js b/components/appointment/information/Detail.js index 189775f..121d0a1 100644 --- a/components/appointment/information/Detail.js +++ b/components/appointment/information/Detail.js @@ -16,7 +16,7 @@ function Detail({ doctor, step, setStep, selectedSlot, selectedDate }) { // فرمت کردن تاریخ به شمسی const formattedDate = selectedDate - ? moment.unix(selectedDate).locale('fa').format('jDD jMMMM jYYYY') + ? moment.unix(selectedDate).utcOffset(210).locale('fa').format('jDD jMMMM jYYYY') : "تاریخ انتخاب نشده"; // فرمت کردن زمان diff --git a/components/appointment/paying/index.js b/components/appointment/paying/index.js index 63a16c6..5b25d78 100644 --- a/components/appointment/paying/index.js +++ b/components/appointment/paying/index.js @@ -92,9 +92,10 @@ function Paying({ setStep, appointmentId, expiresAt, doctor, data, isForAnother,
زمان نوبت - {moment.unix(selectedSlot.start).locale("fa").format("dddd jD jMMMM jYYYY")} + {/* utcOffset(210) = ساعت رسمی ایران (+03:30)، مستقل از tz مرورگر بیمار */} + {moment.unix(selectedSlot.start).utcOffset(210).locale("fa").format("dddd jD jMMMM jYYYY")} {" — ساعت "} - {moment.unix(selectedSlot.start).format("HH:mm")} + {moment.unix(selectedSlot.start).utcOffset(210).format("HH:mm")}
)}