Skip to content

Commit

Permalink
deadline
Browse files Browse the repository at this point in the history
  • Loading branch information
sandeep14k authored Oct 7, 2024
1 parent d8bd477 commit 4a508a3
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions components/Modals/ViewNotice.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,18 @@ const boxStyle = {
overflowY: "scroll",
maxHeight: "90vh",
};

function ViewNotice({ currentNotice }: { currentNotice: NoticeParams }) {
const value = currentNotice.CreatedAt;
const publishedDateAndTime = `${new Date(value).toLocaleDateString(
"en-GB"
)} ${new Date(value).toLocaleTimeString()}`;

const isOpeningTag = currentNotice.tags.includes("opening");
function formatDeadline(deadline: string): string {
return deadline === "0001-01-01T00:00:00Z"
? "N/A"
: new Date(deadline).toLocaleString();
}

const deadlineDate = formatDeadline(currentNotice.deadline);

return (
<Box sx={boxStyle} className="modalScroll">
<Stack spacing={3}>
Expand Down Expand Up @@ -66,7 +62,6 @@ function ViewNotice({ currentNotice }: { currentNotice: NoticeParams }) {
readOnly: true,
}}
/>

{/* Conditionally render the deadline field if "opening" is present in tags */}
{isOpeningTag && (
<TextField
Expand All @@ -79,7 +74,6 @@ function ViewNotice({ currentNotice }: { currentNotice: NoticeParams }) {
}}
/>
)}

<small style={{ fontWeight: 300 }}>Description</small>
<RichText
// eslint-disable-next-line @typescript-eslint/no-empty-function
Expand All @@ -91,5 +85,4 @@ function ViewNotice({ currentNotice }: { currentNotice: NoticeParams }) {
</Box>
);
}

export default ViewNotice;

0 comments on commit 4a508a3

Please sign in to comment.