Cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

active zone minutes clockface

I am coding a clockface. I just run into a problem with the new way of writing the active zone minute.
Now this should have a total. (see screenshots). How can I best solve this without having to recode everything.


this is my code:

let dataTypes = [ "steps", "distance", "calories", "activeZoneMinutes"];


// Refresh data, all other logic is in separate files
function refreshData(type) {
let currentType = type.dataType;

let currentDataProg = (userActivity.today.adjusted[currentType] || 0);
let currentDataGoal = userActivity.goals[currentType];

let currentDataArc = (currentDataProg / currentDataGoal) * 360;

if (currentDataArc > 360) {
currentDataArc = 360;
}

if(currentType==="distance") {
currentDataProg = (currentDataProg * 0.000621371192).toFixed(2);
}

type.arcFront.sweepAngle = currentDataArc;
type.dataCount.text = currentDataProg;
}

Best Answer
0 Votes
1 REPLY 1

Hi @RobbeVanhu  - you'll have to put a conditional test in your routine for active zone minutes to retrieve its value.

Author | ch, passion for improvement.

Best Answer