Skip to content

Commit

Permalink
fix:ticket total hours
Browse files Browse the repository at this point in the history
  • Loading branch information
Innocent-Akim committed Dec 21, 2024
1 parent 2c4f88d commit 540b98a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ export const FilterIcon = () => <svg width="16" height="16" viewBox="0 0 16 16"
*/

export const SearchIcon = () => <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M7.66244 14.0007C11.1602 14.0007 13.9958 11.1651 13.9958 7.66732C13.9958 4.16951 11.1602 1.33398 7.66244 1.33398C4.16463 1.33398 1.3291 4.16951 1.3291 7.66732C1.3291 11.1651 4.16463 14.0007 7.66244 14.0007Z" stroke="#7E7991" strokeLinecap="round" stroke-linejoin="round" />
<path d="M14.6624 14.6673L13.3291 13.334" stroke="#7E7991" strokeLinecap="round" stroke-linejoin="round" />
<path d="M7.66244 14.0007C11.1602 14.0007 13.9958 11.1651 13.9958 7.66732C13.9958 4.16951 11.1602 1.33398 7.66244 1.33398C4.16463 1.33398 1.3291 4.16951 1.3291 7.66732C1.3291 11.1651 4.16463 14.0007 7.66244 14.0007Z" stroke="#7E7991" strokeLinecap="round" strokeLinejoin="round" />
<path d="M14.6624 14.6673L13.3291 13.334" stroke="#7E7991" strokeLinecap="round" strokeLinejoin="round" />
</svg>

/**
Expand Down
16 changes: 11 additions & 5 deletions apps/web/lib/features/task/task-displays.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,16 @@ export function TaskNameInfoDisplay({
}

const formatTime = (hours: number, minutes: number, second?: number) => (
<div className="flex justify-start items-start w-10">
<div className="flex justify-start items-start min-w-[4rem]">
<span>{String(hours).padStart(2, '0')}</span>
<span>:</span>
<span>{String(minutes).padStart(2, '0')}</span>
{second !== undefined && (
<>
<span>:</span>
<span>{String(second).padStart(2, '0')}</span>
</>
)}
<span>h</span>
</div>
);
Expand Down Expand Up @@ -115,10 +121,10 @@ export const TotalTimeDisplay = React.memo(({ timesheetLog, className }: { times
}, 0)
: 0;

const { h: hours, m: minute, s: second } = secondsToTime(totalDuration || 0);
const { h: hours, m: minute } = secondsToTime(totalDuration || 0);
return (
<div className={cn("flex items-center text-[#868688]", className)}>
{formatTime(hours, minute, second)}
{formatTime(hours, minute)}
</div>)
});
TotalTimeDisplay.displayName = 'TotalTimeDisplay';
Expand All @@ -141,10 +147,10 @@ export const TotalDurationByDate = React.memo(
}, 0)
: 0;

const { h: hours, m: minutes, s: second } = secondsToTime(totalDurationInSeconds);
const { h: hours, m: minutes, } = secondsToTime(totalDurationInSeconds);
return (
<div className={clsxm("flex items-center text-[#868688]", className)}>
{formatTime(hours, minutes, second)}
{formatTime(hours, minutes)}
</div>
);
}
Expand Down

0 comments on commit 540b98a

Please sign in to comment.