small refactor timeControl index
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Carlos Jimenez Ruiz 2020-10-29 13:46:36 +01:00
parent 26c9e54663
commit 25684ec521
2 changed files with 1 additions and 6 deletions

View File

@ -1,7 +1,6 @@
import selectors from '../../helpers/selectors.js';
import getBrowser from '../../helpers/puppeteer';
// missing full run validation
describe('Worker time control path', () => {
let browser;
let page;

View File

@ -203,8 +203,6 @@ class Controller extends Section {
}
set weekTotalHours(totalHours) {
if (!totalHours) return this._weekTotalHours = this.formatHours(0);
this._weekTotalHours = this.formatHours(totalHours);
}
@ -212,9 +210,7 @@ class Controller extends Section {
return this._weekTotalHours;
}
formatHours(timestamp) {
timestamp = timestamp || 0;
formatHours(timestamp = 0) {
let hour = Math.floor(timestamp / 3600);
let min = Math.floor(timestamp / 60 - 60 * hour);