feat(timezone): implement Tehran timezone handling across the application

This commit is contained in:
hamed
2026-07-16 00:25:21 +03:30
parent 8cd1253b81
commit 2f060bd5be
10 changed files with 90 additions and 17 deletions
@@ -20,7 +20,7 @@ import { useNavigate } from "react-router-dom";
import { toast } from "sonner";
import type { ApiResponse } from "../lib/api";
import { api } from "../lib/api";
import { formatRial } from "../lib/utils";
import { formatRial, tehranWallClockToUnix } from "../lib/utils";
import type { Appointment } from "../types";
import AppointmentStatusDropdown from "./ui/AppointmentStatusDropdown";
import Modal from "./ui/Modal";
@@ -30,8 +30,7 @@ import PriceInput from "./ui/PriceInput";
/** Row actions for the appointments table (Figma عملیات menu). */
type ModalKind = null | "info" | "move" | "transfer" | "replace";
const toEpoch = (isoDate: string, time: string) =>
Math.floor(new Date(`${isoDate}T${time || "00:00"}`).getTime() / 1000);
const toEpoch = (isoDate: string, time: string) => tehranWallClockToUnix(isoDate, time);
/**
* Resolve the patient-record uuid behind an appointment via the patient list