diff --git a/frontend/src/Components/EditWeeklyReport.tsx b/frontend/src/Components/EditWeeklyReport.tsx index 9dc3d8e..0d6f187 100644 --- a/frontend/src/Components/EditWeeklyReport.tsx +++ b/frontend/src/Components/EditWeeklyReport.tsx @@ -113,9 +113,14 @@ export default function GetWeeklyReport(): JSX.Element { type="number" min="0" className="border-2 border-black rounded-md text-center w-1/2" - value={developmentTime} + value={developmentTime === 0 ? "" : developmentTime} onChange={(e) => { - setDevelopmentTime(parseInt(e.target.value)); + if (e.target.value === "") { + setDevelopmentTime(0); + return; + } else { + setDevelopmentTime(parseInt(e.target.value)); + } }} onKeyDown={(event) => { const keyValue = event.key; @@ -132,9 +137,14 @@ export default function GetWeeklyReport(): JSX.Element { type="number" min="0" className="border-2 border-black rounded-md text-center w-1/2" - value={meetingTime} + value={meetingTime === 0 ? "" : meetingTime} onChange={(e) => { - setMeetingTime(parseInt(e.target.value)); + if (e.target.value === "") { + setMeetingTime(0); + return; + } else { + setMeetingTime(parseInt(e.target.value)); + } }} onKeyDown={(event) => { const keyValue = event.key; @@ -151,9 +161,14 @@ export default function GetWeeklyReport(): JSX.Element { type="number" min="0" className="border-2 border-black rounded-md text-center w-1/2" - value={adminTime} + value={adminTime === 0 ? "" : adminTime} onChange={(e) => { - setAdminTime(parseInt(e.target.value)); + if (e.target.value === "") { + setAdminTime(0); + return; + } else { + setAdminTime(parseInt(e.target.value)); + } }} onKeyDown={(event) => { const keyValue = event.key; @@ -170,9 +185,14 @@ export default function GetWeeklyReport(): JSX.Element { type="number" min="0" className="border-2 border-black rounded-md text-center w-1/2" - value={ownWorkTime} + value={ownWorkTime === 0 ? "" : ownWorkTime} onChange={(e) => { - setOwnWorkTime(parseInt(e.target.value)); + if (e.target.value === "") { + setOwnWorkTime(0); + return; + } else { + setOwnWorkTime(parseInt(e.target.value)); + } }} onKeyDown={(event) => { const keyValue = event.key; @@ -189,9 +209,14 @@ export default function GetWeeklyReport(): JSX.Element { type="number" min="0" className="border-2 border-black rounded-md text-center w-1/2" - value={studyTime} + value={studyTime === 0 ? "" : studyTime} onChange={(e) => { - setStudyTime(parseInt(e.target.value)); + if (e.target.value === "") { + setStudyTime(0); + return; + } else { + setStudyTime(parseInt(e.target.value)); + } }} onKeyDown={(event) => { const keyValue = event.key; @@ -208,9 +233,14 @@ export default function GetWeeklyReport(): JSX.Element { type="number" min="0" className="border-2 border-black rounded-md text-center w-1/2" - value={testingTime} + value={testingTime === 0 ? "" : testingTime} onChange={(e) => { - setTestingTime(parseInt(e.target.value)); + if (e.target.value === "") { + setTestingTime(0); + return; + } else { + setTestingTime(parseInt(e.target.value)); + } }} onKeyDown={(event) => { const keyValue = event.key;