Skip to content
Snippets Groups Projects
Commit 48febaaf authored by Bernard Roland (Student Com20)'s avatar Bernard Roland (Student Com20)
Browse files

Fixed project slide

parent c9b549da
No related branches found
No related tags found
No related merge requests found
......@@ -25,12 +25,15 @@ export default function ProjectSlide({ project }: ProjectSlideProps) {
useEffect(() => {
getProjectAssignees(project.id).then(assignee => {
setAssignees(assignee);
setTotalTime(assignee.map(a => a.time).reduce((total, c) => total + c, 1) * 60 * 1000)
setTotalTime(durationFor(assignee.map(a => a.time).reduce((total, c) => total + c, 0), 'minute'))
});
getProjectWork(project.id).then((work) =>
setTime(
work.map(w => durationBetween(w.started, w.finished ?? new Date()))
.reduce((total, c) => total + c, 0)
durationFor(
work.map(w => durationBetween(w.started, w.finished ?? new Date()))
.reduce((total, c) => total + c, 0),
'millisecond'
)
)
)
}, [project]);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment