[fix] #14867: fix bug with recounting remaining time

parent 04a65e14
......@@ -242,8 +242,18 @@ window.addEventListener("load", function() {
// получаем estimatedTime
const estimatedTime = Number(document.querySelector('#estimated_time').value);
// получаем отработанное время
const workedTime = Number(document.querySelector('.bz_time_tracking_table > tbody:nth-child(1) > tr:nth-child(2) > td:nth-child(3)').innerText);
// пересчитанное отработанное время
const updatedWorkedTime = ((workedTime * 100) + (workTimeValue * 100)) / 100;
console.log("UPDATED", updatedWorkedTime);
// считаем сколько осталось
const remainingTimeValue = ((estimatedTime * 100) - Math.ceil((workTime / 60) * 100)) / 100;
const remainingTimeValue = Math.ceil(((estimatedTime * 100) - (updatedWorkedTime * 100))) / 100;
console.log("REMAINING", remainingTimeValue)
// обновляем оставшееся время
document.querySelector("#remaining_time").value = remainingTimeValue > 0 ? remainingTimeValue : 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment