Skip to content

Commit

Permalink
Fix balance count to account for 2-entries day (#637)
Browse files Browse the repository at this point in the history
  • Loading branch information
thamara committed May 11, 2021
1 parent 74a6c68 commit 0d4e3ea
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions js/time-balance.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,15 +76,15 @@ function _getHoursPerDay()
*/
function _getFlexibleDayTotal(values)
{
const inputsHaveExpectedSize = values.length >= 4 && values.length % 2 === 0;
const inputsHaveExpectedSize = values.length >= 2 && values.length % 2 === 0;
const timesOk = values.length > 0 && values.every(time => time !== '--:--');
const hasDayEnded = inputsHaveExpectedSize && timesOk;

if (hasDayEnded)
{
let dayTotal = '00:00';
let timesAreProgressing = true;
if (values.length >= 4 && values.length % 2 === 0)
if (values.length >= 2 && values.length % 2 === 0)
{
for (let i = 0; i < values.length; i += 2)
{
Expand Down

0 comments on commit 0d4e3ea

Please sign in to comment.