From 6f9640cea6173c7599dae5b9766c5f431ede8e08 Mon Sep 17 00:00:00 2001 From: hamed <15238-genius.ha@users.noreply.drupalcode.org> Date: Thu, 16 Jul 2026 00:30:20 +0330 Subject: [PATCH] fix(payment): adjust date formatting to use UTC offset for consistency --- app/payment/[uuid]/page.js | 1 + components/appointment/information/Detail.js | 2 +- components/appointment/paying/index.js | 5 +++-- 3 files changed, 5 insertions(+), 3 deletions(-) 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")}
)}