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

Time Frozen on some Versas

ANSWERED

I have made a clock face which appears fine in the simulator on the Ionic and all models of Versa including Versa 2. I build with SDK 4.1. Every week or so I get a support mail from Versa users saying they have installed the clock and the Hour is frozen at 12. And its always users in the US. I have tried changing time zone and location on my companion app and on the simulator to see if this has an effect but I cannot reproduce the issue. I suspect some other variable somewhere is causing the hour update not to work. Has anyone come across this issue with other clocks?

Best Answer
0 Votes
1 BEST ANSWER

Accepted Solutions

There's nothing specifically wrong with that line of code, unless you don't have the `hours` variable already defined, or it's not a number, or something?

View best answer in original post

Best Answer
4 REPLIES 4
Give me al linkt to the clockface and I'll try it out.
I think it's stuck on an error.
Community Council MemberMario Dings | Rotterdam NL
Fitbit: Versa, Versa2, Sense. (Versa light) - Phone: Android. - Developer clockfaces.(Nederlands)
Best Answer
0 Votes

Hi Thanks for the offer - here is the link:

 

https://gallery.fitbit.com/details/b4302870-c440-4229-a1c1-6d4d7440c51e

 

But I think I spotted it - I was using a line of code from a sample clock that seemed to cause the issue. I changed my time format on my online profile to 12 hour instead of 24 hour and immediately got the problem. Removed the below line of code and all worked properly. Would still be grateful if you can test and see if it really is fixed though. This is the offending line of code taken from jonFitbit's sample clock on github:

hours = hours % 12 || 12;

Best Answer
0 Votes

There's nothing specifically wrong with that line of code, unless you don't have the `hours` variable already defined, or it's not a number, or something?

Best Answer

Thanks, that gave me a bit of a clue. Its not the line of code itself but rather the processing I do on the hours value to format it. I now do that after I test for the 12 hour clock preference and its now correct in the simulator in 12h format.  

Best Answer