diff --git a/src/components/Patient/PatientHome.tsx b/src/components/Patient/PatientHome.tsx
index e3b8e0b28d8..1f47323204d 100644
--- a/src/components/Patient/PatientHome.tsx
+++ b/src/components/Patient/PatientHome.tsx
@@ -5,6 +5,12 @@ import { useTranslation } from "react-i18next";
import CareIcon from "@/CAREUI/icons/CareIcon";
import { Button } from "@/components/ui/button";
+import {
+ Tooltip,
+ TooltipContent,
+ TooltipProvider,
+ TooltipTrigger,
+} from "@/components/ui/tooltip";
import { Avatar } from "@/components/Common/Avatar";
import Loading from "@/components/Common/Loading";
@@ -17,7 +23,7 @@ import {
import { PLUGIN_Component } from "@/PluginEngine";
import routes from "@/Utils/request/api";
import query from "@/Utils/request/query";
-import { formatDateTime, formatPatientAge, relativeDate } from "@/Utils/utils";
+import { formatDateTime, formatPatientAge, relativeTime } from "@/Utils/utils";
import { Patient } from "@/types/emr/newPatient";
export const PatientHome = (props: {
@@ -139,7 +145,7 @@ export const PatientHome = (props: {
/>
)}
-
+
@@ -148,21 +154,6 @@ export const PatientHome = (props: {
-
-
-
+
-
- {t("last_updated_by")}{" "}
-
+
+ {t("last_updated_by")}
+
{patientData.updated_by?.first_name}{" "}
{patientData.updated_by?.last_name}
-
-
-
-
-
- {patientData.modified_date
- ? formatDateTime(patientData.modified_date)
- : "--:--"}
-
- {patientData.modified_date
- ? relativeDate(patientData.modified_date)
- : "--:--"}
+
+
+ {patientData.modified_date ? (
+
+
+
+
+ {relativeTime(patientData.modified_date)}
+
+
+
+ {formatDateTime(patientData.modified_date)}
+
+
+
+ ) : (
+ "--:--"
+ )}
+
- {t("patient_profile_created_by")}{" "}
-
+ {t("patient_profile_created_by")}
+
{patientData.created_by?.first_name}{" "}
{patientData.created_by?.last_name}
-
-
-
-
-
- {patientData.created_date
- ? formatDateTime(patientData.created_date)
- : "--:--"}
-
- {patientData.created_date
- ? relativeDate(patientData.created_date)
- : "--:--"}
+
+ {patientData.created_date ? (
+
+
+
+
+ {relativeTime(patientData.created_date)}
+
+
+
+ {formatDateTime(patientData.created_date)}
+
+
+
+ ) : (
+ "--:--"
+ )}
+
diff --git a/src/pages/Appointments/AppointmentsPage.tsx b/src/pages/Appointments/AppointmentsPage.tsx
index 6b939f54fac..5b227bdbe9b 100644
--- a/src/pages/Appointments/AppointmentsPage.tsx
+++ b/src/pages/Appointments/AppointmentsPage.tsx
@@ -677,6 +677,7 @@ function AppointmentColumn(props: {
date_before: props.date_to,
},
}),
+ enabled: !!props.date_from && !!props.date_to,
});
let appointments = data?.results ?? [];
@@ -801,6 +802,7 @@ function AppointmentRow(props: {
date_before: props.date_to,
},
}),
+ enabled: !!props.date_from && !!props.date_to,
});
let appointments = data?.results ?? [];