@@ -6,7 +6,7 @@ import { | |||||
} from "@/app/api/timesheets/utils"; | } from "@/app/api/timesheets/utils"; | ||||
import { shortDateFormatter } from "@/app/utils/formatUtil"; | import { shortDateFormatter } from "@/app/utils/formatUtil"; | ||||
import { roundToNearestQuarter } from "@/app/utils/manhourUtils"; | import { roundToNearestQuarter } from "@/app/utils/manhourUtils"; | ||||
import { Check, Delete } from "@mui/icons-material"; | |||||
import { Check, Delete, Close } from "@mui/icons-material"; | |||||
import { | import { | ||||
Box, | Box, | ||||
Button, | Button, | ||||
@@ -173,6 +173,13 @@ const LeaveEditModal: React.FC<Props> = ({ | |||||
{t("Delete")} | {t("Delete")} | ||||
</Button> | </Button> | ||||
)} | )} | ||||
<Button | |||||
variant="outlined" | |||||
startIcon={<Close />} | |||||
onClick={(event) => closeHandler(event, "backdropClick")} | |||||
> | |||||
{t("Close")} | |||||
</Button> | |||||
<Button | <Button | ||||
variant="contained" | variant="contained" | ||||
startIcon={<Check />} | startIcon={<Check />} | ||||
@@ -2,7 +2,7 @@ import { | |||||
RecordTimesheetInput, | RecordTimesheetInput, | ||||
RecordLeaveInput, | RecordLeaveInput, | ||||
} from "@/app/api/timesheets/actions"; | } from "@/app/api/timesheets/actions"; | ||||
import { shortDateFormatter } from "@/app/utils/formatUtil"; | |||||
import { manhourFormatter, shortDateFormatter } from "@/app/utils/formatUtil"; | |||||
import { Box, Stack, Typography } from "@mui/material"; | import { Box, Stack, Typography } from "@mui/material"; | ||||
import dayjs from "dayjs"; | import dayjs from "dayjs"; | ||||
import React, { useMemo } from "react"; | import React, { useMemo } from "react"; | ||||
@@ -28,6 +28,7 @@ const PastEntryList: React.FC<Props> = ({ | |||||
allProjects, | allProjects, | ||||
}) => { | }) => { | ||||
const { | const { | ||||
t, | |||||
i18n: { language }, | i18n: { language }, | ||||
} = useTranslation("home"); | } = useTranslation("home"); | ||||
@@ -93,6 +94,16 @@ const PastEntryList: React.FC<Props> = ({ | |||||
leaveTypeMap={leaveTypeMap} | leaveTypeMap={leaveTypeMap} | ||||
/> | /> | ||||
))} | ))} | ||||
<Typography | |||||
variant="overline" | |||||
> | |||||
{t("Total Work Hours")}: {manhourFormatter.format(timeEntries.map(entry => (entry.inputHours ?? 0) + (entry.otHours ?? 0)).reduce((acc, cur) => { return acc + cur }, 0))} | |||||
</Typography> | |||||
<Typography | |||||
variant="overline" | |||||
> | |||||
{t("Total Leave Hours")}: {manhourFormatter.format(leaveEntries.map(entry => entry.inputHours).reduce((acc, cur) => { return acc + cur }, 0))} | |||||
</Typography> | |||||
</Box> | </Box> | ||||
</Stack> | </Stack> | ||||
); | ); | ||||
@@ -1,5 +1,5 @@ | |||||
import { TimeEntry } from "@/app/api/timesheets/actions"; | import { TimeEntry } from "@/app/api/timesheets/actions"; | ||||
import { Check, Delete } from "@mui/icons-material"; | |||||
import { Check, Delete, Close } from "@mui/icons-material"; | |||||
import { | import { | ||||
Box, | Box, | ||||
Button, | Button, | ||||
@@ -297,6 +297,13 @@ const TimesheetEditModal: React.FC<Props> = ({ | |||||
{t("Delete")} | {t("Delete")} | ||||
</Button> | </Button> | ||||
)} | )} | ||||
<Button | |||||
variant="outlined" | |||||
startIcon={<Close />} | |||||
onClick={(event) => closeHandler(event, "backdropClick")} | |||||
> | |||||
{t("Close")} | |||||
</Button> | |||||
<Button | <Button | ||||
variant="contained" | variant="contained" | ||||
startIcon={<Check />} | startIcon={<Check />} | ||||