Skip to content

Commit

Permalink
fix hours on view
Browse files Browse the repository at this point in the history
  • Loading branch information
MathiasSJacobsen committed Nov 3, 2020
1 parent 243352d commit a0f7d86
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/Frontend/utils.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -94,18 +94,17 @@ export const selectGroups = ({ groups }, lang) => {
};

const calculateEndTime = (startTime, minUsed) => {
const arr = startTime.split(":");
let hours = Math.floor(parseInt(minUsed) / 60);
const hours_min = startTime.split(":");
let hours = Math.floor((parseInt(minUsed) + parseInt(hours_min[1])) / 60);

let min = parseInt(arr[1]) + parseInt(minUsed);
let min = parseInt(hours_min[1]) + parseInt(minUsed);
if (!(min < 60)) {
min -= 60;
}
if (min < 10){
min = "0" + min
}

const final_hours = parseInt(arr[0]) + hours;
const final_hours = parseInt(hours_min[0]) + hours;
const final = final_hours + ":" + min;

return final;
Expand Down

0 comments on commit a0f7d86

Please sign in to comment.