Skip to content

Commit

Permalink
fix(LibreOne): fix last_access parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
jakeaturner committed Jun 18, 2024
1 parent 45b887f commit e212b95
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import useGlobalError from "../../error/ErrorHooks";
import { copyToClipboard, dirtyValues } from "../../../utils/misc";
import LoadingSpinner from "../../LoadingSpinner";
import { CentralIdentityApp } from "../../../types/CentralIdentity";
import { format, parseISO } from "date-fns";
const AddUserAppModal = lazy(() => import("./AddUserAppModal"));
const AddUserOrgModal = lazy(() => import("./AddUserOrgModal"));
const ConfirmRemoveOrgOrAppModal = lazy(
Expand Down Expand Up @@ -91,6 +92,8 @@ const ManageUserModal: React.FC<ManageUserModalProps> = ({
user_type: "student",
student_id: "",
avatar: DEFAULT_AVATAR_URL,
last_access: "",
last_password_change: "",
},
});

Expand Down Expand Up @@ -556,7 +559,13 @@ const ManageUserModal: React.FC<ManageUserModalProps> = ({
</div>
<div className="flex-row-div mb-2p">
<p>
<strong>Time of Last Access:</strong> Unknown
<strong>Time of Last Access: </strong>
{getValues("last_access")
? format(
parseISO(getValues("last_access") as string),
"MM/dd/yyyy hh:mm aa"
)
: "Unknown"}
</p>
</div>
<div className="flex-row-div">
Expand Down
1 change: 1 addition & 0 deletions client/src/types/CentralIdentity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ export type CentralIdentityUser = {
first_name: string;
last_name: string;
last_password_change: string | null;
last_access?: string | null;
legacy: boolean;
organizations: CentralIdentityOrg[];
registration_complete: boolean | null;
Expand Down

0 comments on commit e212b95

Please sign in to comment.