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

user-activity today.local/adjusted is undefined on Versa [fixed]

ANSWERED

I targeted my Versa device from Fitbit Studio and am using SDK 4.  In package.json, I checked the boxes for Activity, User profile, and Heart rate.   I can get and display data from user-profile and show the current time.

 

But both today.local and today.adjusted are undefined.  I am already checking if the "access_activity" permission is granted.  

 

import clock from "clock";
import document from "document";

import { me as appbit } from 'appbit';
import { today } from "user-activity";
import { user } from "user-profile";

clock.ontick = (evt) => {

   // clock stuff here (this works)   Edit: I had today = evt.date here which re-assigns var!

   console.log((user.restingHeartRate || "Unknown") + " BPM");  // this works

   if (appbit.permissions.granted("access_activity")) {
      console.log(today.local);  // undefined

   }

}

I'm stumped!

Best Answer
0 Votes
1 BEST ANSWER

Accepted Solutions

Nevermind!  The  'today' variable was being overwritten by let today = evt.date;  which I had copied from the Getting Started tutorial.   Changing that to use a different variable name fixed my problem.

View best answer in original post

Best Answer
1 REPLY 1

Nevermind!  The  'today' variable was being overwritten by let today = evt.date;  which I had copied from the Getting Started tutorial.   Changing that to use a different variable name fixed my problem.

Best Answer