Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use relative time for audit log details. #6640

Merged
merged 11 commits into from
Dec 6, 2023
39 changes: 21 additions & 18 deletions src/Components/Shifting/ShiftDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -800,33 +800,36 @@ export default function ShiftDetails(props: { id: string }) {
<div className="col-span-2">
<h4 className="mt-8">{t("audit_log")}</h4>

<div className="mt-2 grid rounded-lg bg-white p-2 px-4 text-center shadow lg:grid-cols-2">
<div className="border-b-2 pb-2 lg:border-b-0 lg:border-r-2 lg:pb-0">
<div className="text-sm font-medium leading-5 text-gray-500">
{t("created")}
<div className="mt-2 grid rounded-lg bg-white p-2 px-4 text-center shadow lg:grid-rows-2">
<div className="flex flex-col items-center border-b-2 pb-2">
<div className="text-md font-medium leading-5 text-gray-500">
{t("last_edited")}
</div>
<div className="mt-1 whitespace-pre text-sm leading-5 text-gray-900">
<div className="text-sm">
{data?.created_by_object?.first_name}
{data?.created_by_object?.last_name}
</div>
<div className="text-xs">
{data?.created_date && formatDateTime(data?.created_date)}
{data?.modified_date && (
<RecordMeta
user={data?.last_edited_by_object}
inlineUser={true}
time={data?.modified_date}
/>
)}
</div>
</div>
</div>
<div className="mt-2 lg:mt-0">
<div className="text-sm font-medium leading-5 text-gray-500">
{t("last_edited")}
<div className="mt-2 flex flex-col items-center">
<div className="text-md font-medium leading-5 text-gray-500">
{t("created")}
</div>
<div className="mt-1 whitespace-pre text-sm leading-5 text-gray-900">
<div className="text-sm">
{data?.last_edited_by_object?.first_name}{" "}
{data?.last_edited_by_object?.last_name}
</div>
<div className="text-xs">
{data?.modified_date &&
formatDateTime(data?.modified_date)}
{data?.created_date && (
<RecordMeta
user={data?.created_by_object}
inlineUser={true}
time={data?.created_date}
/>
)}
</div>
</div>
</div>
Expand Down
Loading