10-04-2017 19:46
10-04-2017 19:46
New programmer here... I have created a clock face that has a primary time that is always displayed. Below that is either the UTC time or the date. What is displayed changes with .onclick. My problem is that I can only update one item based on clock.ontick. So, I can either update the primary time, the UTC time or the date. How do I update both clocks at the same time? My current work around is to force an update when I click on the element to show it again. My next feet of daring will be to add in a third option of displaying my current steps. I shouldn't have to cycle through for these items to update. Any help would be appreciated.
Jeff
Answered! Go to the Best Answer.
Best Answer10-05-2017 02:11
Fitbit Developers oversee the SDK and API forums. We're here to answer questions about Fitbit developer tools, assist with projects, and make sure your voice is heard by the development team.
10-05-2017 02:11
You should be able to move your logic inside a single update procedure, something like:
function updateClock() {
let today = new Date();
// Update primary time
// Update UTC time
// Update step count
}
clock.ontick = () => updateClock();
Best Answer10-05-2017 02:11
Fitbit Developers oversee the SDK and API forums. We're here to answer questions about Fitbit developer tools, assist with projects, and make sure your voice is heard by the development team.
10-05-2017 02:11
You should be able to move your logic inside a single update procedure, something like:
function updateClock() {
let today = new Date();
// Update primary time
// Update UTC time
// Update step count
}
clock.ontick = () => updateClock();
Best Answer10-05-2017 05:24
10-05-2017 05:24
Thank you. I knew there had to be an easy solution!
Best Answer