From d0fdfc9243523b042867ef01c7462a727fba0247 Mon Sep 17 00:00:00 2001 From: Ashesh <3626859+Ashesh3@users.noreply.github.com> Date: Fri, 19 Jan 2024 17:59:31 +0530 Subject: [PATCH] Include start date for Prescription timeline cells (#7067) * Include start date for Prescription timeline cells * Change heading * heading --- .../AdministrationEventCell.tsx | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/Components/Medicine/MedicineAdministrationSheet/AdministrationEventCell.tsx b/src/Components/Medicine/MedicineAdministrationSheet/AdministrationEventCell.tsx index 1bcfc24a80a..c62af53c8bb 100644 --- a/src/Components/Medicine/MedicineAdministrationSheet/AdministrationEventCell.tsx +++ b/src/Components/Medicine/MedicineAdministrationSheet/AdministrationEventCell.tsx @@ -1,7 +1,7 @@ import dayjs from "../../../Utils/dayjs"; import { MedicineAdministrationRecord, Prescription } from "../models"; import CareIcon from "../../../CAREUI/icons/CareIcon"; -import { classNames, formatDateTime, formatTime } from "../../../Utils/utils"; +import { classNames, formatDateTime } from "../../../Utils/utils"; import DialogModal from "../../Common/Dialog"; import PrescrpitionActivityTimeline from "../PrescrpitionTimeline"; import { useState } from "react"; @@ -21,10 +21,10 @@ export default function AdministrationEventCell({ refetch, }: Props) { const [showTimeline, setShowTimeline] = useState(false); - // Check if cell belongs to an administered prescription + // Check if cell belongs to an administered prescription (including start and excluding end) const administered = administrations .filter((administration) => - dayjs(administration.administered_date).isBetween(start, end) + dayjs(administration.administered_date).isBetween(start, end, null, "[)") ) .sort( (a, b) => @@ -46,9 +46,7 @@ export default function AdministrationEventCell({ show={showTimeline} >
- Administrations between{" "} - {formatTime(start, "HH:mm")} and{" "} - {formatTime(end, "HH:mm")} on{" "} + Administrations on{" "} {formatDateTime(start, "DD/MM/YYYY")}