Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
ecnivtwelve committed Jan 7, 2025
2 parents 41a6b3f + ef24ba2 commit b52afb1
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/views/account/Attendance/Atoms/AttendanceItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,16 @@ const AttendanceItem: React.FC<AttendanceItemProps> = ({
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;
Expand Down

0 comments on commit b52afb1

Please sign in to comment.