[fix] #14867: fix remaining time recounting

parent c1c877f8
...@@ -239,6 +239,15 @@ window.addEventListener("load", function() { ...@@ -239,6 +239,15 @@ window.addEventListener("load", function() {
document.querySelector("#work_time").value = workTimeValue; document.querySelector("#work_time").value = workTimeValue;
document.querySelector("#productive_time").value = productiveTimeValue; document.querySelector("#productive_time").value = productiveTimeValue;
// получаем estimatedTime
const estimatedTime = Number(document.querySelector('#estimated_time').value);
// считаем сколько осталось
const remainingTimeValue = ((estimatedTime * 100) - Math.ceil((workTime / 60) * 100)) / 100;
// обновляем оставшееся время
document.querySelector("#remaining_time").value = remainingTimeValue > 0 ? remainingTimeValue : 0;
// now we ready for submiting all forms // now we ready for submiting all forms
let mainCommitBtn = document.querySelector("#commit_top"); let mainCommitBtn = document.querySelector("#commit_top");
......
...@@ -46,4 +46,4 @@ ...@@ -46,4 +46,4 @@
<script language="javascript" type="text/javascript" src="js/etersoft/focusManager.js"></script> <script language="javascript" type="text/javascript" src="js/etersoft/focusManager.js"></script>
<script language="javascript" type="text/javascript" src="js/etersoft/timer_common.js?25_10_2017"></script> <script language="javascript" type="text/javascript" src="js/etersoft/timer_common.js?25_10_2017"></script>
<script language="javascript" type="text/javascript" src="js/etersoft/timer.js?10_11_2020"></script> <script language="javascript" type="text/javascript" src="js/etersoft/timer.js?24_02_2021"></script>
...@@ -46,4 +46,4 @@ ...@@ -46,4 +46,4 @@
<script language="javascript" type="text/javascript" src="js/etersoft/focusManager.js"></script> <script language="javascript" type="text/javascript" src="js/etersoft/focusManager.js"></script>
<script language="javascript" type="text/javascript" src="js/etersoft/timer_common.js?25_10_2017"></script> <script language="javascript" type="text/javascript" src="js/etersoft/timer_common.js?25_10_2017"></script>
<script language="javascript" type="text/javascript" src="js/etersoft/timer.js?10_11_2020"></script> <script language="javascript" type="text/javascript" src="js/etersoft/timer.js?24_02_2021"></script>
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