Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
bugzilla
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
bugzilla
Commits
103d7dc8
Commit
103d7dc8
authored
Feb 24, 2021
by
Давид Добряков
2
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[fix] #14867: fix bug creating
parent
7da229e6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
12 deletions
+13
-12
timer.js
js/etersoft/timer.js
+13
-12
No files found.
js/etersoft/timer.js
View file @
103d7dc8
...
@@ -240,23 +240,24 @@ window.addEventListener("load", function() {
...
@@ -240,23 +240,24 @@ window.addEventListener("load", function() {
document
.
querySelector
(
"#productive_time"
).
value
=
productiveTimeValue
;
document
.
querySelector
(
"#productive_time"
).
value
=
productiveTimeValue
;
// получаем estimatedTime
// получаем estimatedTime
const
estimatedTime
=
Number
(
document
.
querySelector
(
'#estimated_time'
).
value
);
const
estimatedTimeElement
=
document
.
querySelector
(
'#estimated_time'
);
const
workedTimeElement
=
document
.
querySelector
(
'.bz_time_tracking_table > tbody:nth-child(1) > tr:nth-child(2) > td:nth-child(3)'
);
// получаем отработанное время
if
(
estimatedTimeElement
&&
workedTimeElement
)
{
const
workedTime
=
Number
(
document
.
querySelector
(
'.bz_time_tracking_table > tbody:nth-child(1) > tr:nth-child(2) > td:nth-child(3)'
).
innerText
);
const
estimatedTime
=
Number
(
estimatedTimeElement
.
value
);
// пересчитанное
отработанное время
// получаем
отработанное время
const
updatedWorkedTime
=
((
workedTime
*
100
)
+
(
workTimeValue
*
100
))
/
100
;
const
workedTime
=
Number
(
workedTimeElement
.
innerText
)
;
console
.
log
(
"UPDATED"
,
updatedWorkedTime
);
// пересчитанное отработанное время
const
updatedWorkedTime
=
((
workedTime
*
100
)
+
(
workTimeValue
*
100
))
/
100
;
// считаем сколько осталось
const
remainingTimeValue
=
Math
.
ceil
(((
estimatedTime
*
100
)
-
(
updatedWorkedTime
*
100
)))
/
100
;
console
.
log
(
"REMAINING"
,
remainingTimeValue
)
// считаем сколько осталось
const
remainingTimeValue
=
Math
.
ceil
(((
estimatedTime
*
100
)
-
(
updatedWorkedTime
*
100
)))
/
100
;
// обновляем оставшееся время
// обновляем оставшееся время
document
.
querySelector
(
"#remaining_time"
).
value
=
remainingTimeValue
>
0
?
remainingTimeValue
:
0
;
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"
);
...
...
Vitaly Lipatov
@lav
mentioned in commit
526f3282
·
Jul 26, 2026
mentioned in commit
526f3282
mentioned in commit 526f328209f96b13bb48f4fe84cdcafa6cc44fe5
Toggle commit list
Vitaly Lipatov
@lav
mentioned in commit
1a0cbe5c
·
Jul 26, 2026
mentioned in commit
1a0cbe5c
mentioned in commit 1a0cbe5c1e74857047d8386902b689afae60a858
Toggle commit list
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment