chore: duration calculation (#1770)

This commit is contained in:
katherinehhh 2023-05-05 10:51:25 +08:00 committed by GitHub
parent e5d286a131
commit 6d342d0643
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -125,10 +125,9 @@ export const StandardTooltipContent: React.FC<{
{task.name}: {getYmd(task.start)} ~ {getYmd(task.end)}
</b>
{task.end.getTime() - task.start.getTime() !== 0 && (
<p className={cx(tooltipDefaultContainerParagraph)}>{`Duration: ${~~(
(task.end.getTime() - task.start.getTime()) /
(1000 * 60 * 60 * 24)
)} day(s)`}</p>
<p className={cx(tooltipDefaultContainerParagraph)}>{`Duration: ${
Math.round(((task.end.getTime() - task.start.getTime()) / (1000 * 60 * 60 * 24)) * 10) / 10
} day(s)`}</p>
)}
<p className={cx(tooltipDefaultContainerParagraph)}>{!!task.progress && `Progress: ${task.progress}%`}</p>