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
Fitbit Product Experts Alumni are retired members of the Fitbit Product Expert Program. Learn more