Skip to content

Commit

Permalink
Fixed deadline time left (#407)
Browse files Browse the repository at this point in the history
* fixed deadline time left

* > to >=
  • Loading branch information
Vucis authored May 23, 2024
1 parent 253ab7b commit df9587f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions frontend/src/components/Courses/CourseUtilComponents.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -286,10 +286,10 @@ function EmptyOrNotProjects({
const deadlineDate = deadline.date;
const diffTime = Math.abs(deadlineDate.getTime() - now.getTime());
const diffHours = Math.ceil(diffTime / (1000 * 60 * 60));
const diffDays = Math.ceil(diffHours * 24);
const diffDays = Math.floor(diffHours / 24);

timeLeft =
diffDays > 1 ? `${diffDays} days` : `${diffHours} hours`;
diffDays >= 1 ? `${diffDays} days` : `${diffHours} hours`;
}
}
return (
Expand Down

0 comments on commit df9587f

Please sign in to comment.