From 0794a87bdedd67db8e3514cc7c48177483b65a3c Mon Sep 17 00:00:00 2001 From: oxrsh <87929428+oxrsh@users.noreply.github.com> Date: Mon, 6 Jan 2025 22:06:19 +0100 Subject: [PATCH 1/4] fix(attendances): attendance duration bug fix --- src/views/account/Attendance/Atoms/AttendanceItem.tsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/views/account/Attendance/Atoms/AttendanceItem.tsx b/src/views/account/Attendance/Atoms/AttendanceItem.tsx index c514ce179..66e43f9b0 100644 --- a/src/views/account/Attendance/Atoms/AttendanceItem.tsx +++ b/src/views/account/Attendance/Atoms/AttendanceItem.tsx @@ -74,14 +74,16 @@ const AttendanceItem: React.FC = ({ let totalTime = ""; if ("hours" in item) { const [hours, minutes] = item.hours.split("h").map(Number); - totalTime = hours + "h " + leadingZero(minutes) + "min"; + if (hours == 0) { + totalTime = leadingZero(minutes) + "min"; + } else { + totalTime = hours + "h " + leadingZero(minutes) + "min"; + } } else if ("duration" in item) { totalTime = item.duration + " min"; } - totalTime = totalTime.replace("0h ", ""); - const timestamp = "fromTimestamp" in item ? item.fromTimestamp : item.timestamp; const not_justified = "justified" in item && !item.justified; const justification = "reasons" in item ? item.reasons || NO_JUSTICATION : "reason" in item ? item.reason.text : NO_JUSTICATION; From 71a0c4a5efc5a640d6e7f13e03c22a850c7454af Mon Sep 17 00:00:00 2001 From: oxrs_ <87929428+oxrsh@users.noreply.github.com> Date: Mon, 6 Jan 2025 22:42:46 +0100 Subject: [PATCH 2/4] Update AttendanceItem.tsx MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: 𝕂𝕪𝕝𝕚𝕒𝕟 <164187100+Kgeek33@users.noreply.github.com> --- src/views/account/Attendance/Atoms/AttendanceItem.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/views/account/Attendance/Atoms/AttendanceItem.tsx b/src/views/account/Attendance/Atoms/AttendanceItem.tsx index 863d5e392..acf4331da 100644 --- a/src/views/account/Attendance/Atoms/AttendanceItem.tsx +++ b/src/views/account/Attendance/Atoms/AttendanceItem.tsx @@ -74,7 +74,7 @@ const AttendanceItem: React.FC = ({ let totalTime = ""; if ("hours" in item) { const [hours, minutes] = item.hours.split("h").map(Number); - if (hours == 0) { + if (hours === 0) { totalTime = leadingZero(minutes) + "min"; } else { totalTime = hours + "h " + leadingZero(minutes) + "min"; From fca67ba76367996d1e945520ec41701d879e3a4c Mon Sep 17 00:00:00 2001 From: oxrs_ <87929428+oxrsh@users.noreply.github.com> Date: Mon, 6 Jan 2025 22:42:56 +0100 Subject: [PATCH 3/4] Update AttendanceItem.tsx MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: 𝕂𝕪𝕝𝕚𝕒𝕟 <164187100+Kgeek33@users.noreply.github.com> --- src/views/account/Attendance/Atoms/AttendanceItem.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/views/account/Attendance/Atoms/AttendanceItem.tsx b/src/views/account/Attendance/Atoms/AttendanceItem.tsx index acf4331da..ee738f15e 100644 --- a/src/views/account/Attendance/Atoms/AttendanceItem.tsx +++ b/src/views/account/Attendance/Atoms/AttendanceItem.tsx @@ -75,7 +75,7 @@ const AttendanceItem: React.FC = ({ if ("hours" in item) { const [hours, minutes] = item.hours.split("h").map(Number); if (hours === 0) { - totalTime = leadingZero(minutes) + "min"; + totalTime = `${leadingZero(minutes)} min`; } else { totalTime = hours + "h " + leadingZero(minutes) + "min"; } From dd6c7400fc8b8cb9b45eb7137497a70cbd3788c9 Mon Sep 17 00:00:00 2001 From: oxrs_ <87929428+oxrsh@users.noreply.github.com> Date: Mon, 6 Jan 2025 22:43:24 +0100 Subject: [PATCH 4/4] Update AttendanceItem.tsx MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: 𝕂𝕪𝕝𝕚𝕒𝕟 <164187100+Kgeek33@users.noreply.github.com> --- src/views/account/Attendance/Atoms/AttendanceItem.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/views/account/Attendance/Atoms/AttendanceItem.tsx b/src/views/account/Attendance/Atoms/AttendanceItem.tsx index ee738f15e..a9cc70cc2 100644 --- a/src/views/account/Attendance/Atoms/AttendanceItem.tsx +++ b/src/views/account/Attendance/Atoms/AttendanceItem.tsx @@ -77,7 +77,7 @@ const AttendanceItem: React.FC = ({ if (hours === 0) { totalTime = `${leadingZero(minutes)} min`; } else { - totalTime = hours + "h " + leadingZero(minutes) + "min"; + totalTime = `${hours}h ${leadingZero(minutes)}min`; } } else if ("duration" in item) {