- {data.location} + {data.address}
- ساعت کاری: {data.hours_of_work} + ساعت کاری: {data.field_working_days}
اشتراک گذاری
-آدرس:
- {data?.location} +
+ {data?.address[0]?.address}
تلفن:
- {data?.phone} -
-- {data?.phone} - {data?.phone} + {data?.address[0]?.phone}
+ {/*+ {data?.address[0]?.phone} - {data?.address[0]?.phone} +
*/}nobat724.com
+
{data?.name}
-+
تخصص: {data?.expertise?.map( (item, idx) => diff --git a/components/doctors/listDoctors/timestamp_to_persian_date.js b/components/doctors/listDoctors/timestamp_to_persian_date.js deleted file mode 100644 index ac4dfe3..0000000 --- a/components/doctors/listDoctors/timestamp_to_persian_date.js +++ /dev/null @@ -1,90 +0,0 @@ -export function convertTimestampToPersianDate(timestamp) { - // Convert timestamp to milliseconds (JavaScript uses milliseconds) - const date = new Date(timestamp * 1000); - - // Format with Persian calendar and Tehran timezone - const options = { - timeZone: "Asia/Tehran", - calendar: "persian", - year: "numeric", - month: "2-digit", - day: "2-digit", - weekday: "long", - hour: "2-digit", - minute: "2-digit", - second: "2-digit", - hour12: true, - }; - - const formatter = new Intl.DateTimeFormat("fa-IR", options); - const parts = formatter.formatToParts(date); - - // Extract parts - const weekday = parts.find((part) => part.type === "weekday").value; - const year = parts.find((part) => part.type === "year").value; - const month = parts.find((part) => part.type === "month").value; - const day = parts.find((part) => part.type === "day").value; - const hour = parts.find((part) => part.type === "hour").value; - const minute = parts.find((part) => part.type === "minute").value; - const second = parts.find((part) => part.type === "second").value; - const dayPeriod = parts.find((part) => part.type === "dayPeriod").value; - - // Format the final string - return `${weekday}, ${year}-${month}-${day} ${hour}:${minute}:${second} ${dayPeriod}`; -} - -// Alternative simpler approach using toLocaleString -export function convertTimestampToPersianDateSimple(timestamp) { - const date = new Date(timestamp * 1000); - - const options = { - timeZone: "Asia/Tehran", - calendar: "persian", - year: "numeric", - month: "2-digit", - day: "2-digit", - weekday: "long", - hour: "2-digit", - minute: "2-digit", - second: "2-digit", - hour12: true, - }; - - return date.toLocaleString("fa-IR", options); -} - -// Example usage -const timestamp = 1759132200; - -console.log("Method 1 (formatToParts):"); -console.log(convertTimestampToPersianDate(timestamp)); - -console.log("\nMethod 2 (toLocaleString):"); -console.log(convertTimestampToPersianDateSimple(timestamp)); - -// For more control over the format, you can create a custom formatter -export function convertTimestampCustomFormat(timestamp) { - const date = new Date(timestamp * 1000); - - const options = { - timeZone: "Asia/Tehran", - calendar: "persian", - year: "numeric", - month: "2-digit", - day: "2-digit", - weekday: "long", - hour: "2-digit", - minute: "2-digit", - second: "2-digit", - hour12: true, - }; - - const formatter = new Intl.DateTimeFormat("fa-IR", options); - const formatted = formatter.format(date); - - // Add bullet point if needed - return `* ${formatted}`; -} - -console.log("\nMethod 3 (with bullet point):"); -console.log(convertTimestampCustomFormat(timestamp)); diff --git a/helper/index.js b/helper/index.js index 4aad278..ee46abe 100644 --- a/helper/index.js +++ b/helper/index.js @@ -390,6 +390,12 @@ export const QueryForClinicsFilter = (searchParams) => { } } + // 🔹 page + if (searchParams.page) params.page = searchParams.page; + + // 🔹 limit + if (searchParams.limit) params.limit = searchParams.limit; + return params; }; @@ -493,6 +499,12 @@ export const buildClinicParams = (searchParams) => { } } + // 🔹 page + if (searchParams.page) { + params.page = searchParams.page; + params.limit = 12; + } + return params; }; @@ -525,3 +537,22 @@ export function isUserLoggedIn() { const userInfo = Cookies.get("userInfo"); return !!userInfo; } + +export function convertTimestampToPersianDateSimple(timestamp) { + const date = new Date(timestamp * 1000); + + const options = { + timeZone: "Asia/Tehran", + calendar: "persian", + year: "numeric", + month: "2-digit", + day: "2-digit", + weekday: "long", + hour: "2-digit", + minute: "2-digit", + second: "2-digit", + hour12: true, + }; + + return date.toLocaleString("fa-IR", options); +}