[go: up one dir, main page]

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

    Problems with Steps and Distance

    Hello all,

    i`m new in js and have problems to integrate steps (right) and distance (middle) in my clockdesign for versa.

     

    Zip-File: https://files.fm/u/x94zzmpd

     

    Could somebody help me or build it for me 😞

     

    MSVforVersa.PNG

    Best Answer
    0 Votes
    1 REPLY 1

    You need to import the user activity module:

    import { today } from "user-activity";

    Put ID's on your text field labels, and get a handle on them in code:

    let myStepsLabel = document.getElementById("myStepsLabel");
    let myDistanceLabel = document.getElementById("myDistanceLabel");

    Then update your text fields with these values inside the clock tick event:

    myStepsLabel.text = today.adjusted.steps;
    myDistanceLabel.text = today.adjusted.distance;

     

     

     

    Best Answer