06-03-2022
11:00
- last edited on
06-08-2022
08:01
by
AndreaFitbit
06-03-2022
11:00
- last edited on
06-08-2022
08:01
by
AndreaFitbit
I am making my own watch face on fitbit studio for my versa 2 and I have a background I want and it is on it and I also have the time where I want it but I am trying to put the battery life indicator on it and the date on it. I am not exacly shore how to do this. I am new at this and am not familiar with coding language.
Can anyone help?
Moderator edit: updated subject for clarity.
06-03-2022 19:26
06-03-2022 19:26
Hi @track03 - have a look at
https://dev.fitbit.com/build/reference/device-api/power/
If you want to display it only when it changes try something like
battery.onchange = (charger, evt) => {
myBattery.text = `${battery.chargeLevel}%`;
}
For date, various formats are shown
https://www.w3schools.com/js/js_date_formats.asp
Author | ch, passion for improvement.
06-04-2022
10:25
- last edited on
06-07-2022
11:30
by
DavideFitbit
06-04-2022
10:25
- last edited on
06-07-2022
11:30
by
DavideFitbit
I will try, but when I do something like that it say build complete, then a app installed but it does't show on my watch.
do you know why that is?
and also if it was going to work which file spot wood I put then in?
06-04-2022 11:19 - edited 06-04-2022 11:21
06-04-2022 11:19 - edited 06-04-2022 11:21
06-04-2022 13:19
06-04-2022 13:19
I have tryed that but when I try to load it, it says oops, the simulator is not working and then it gives me the option to try again and it says the same thing. ??????????
06-04-2022 16:27
06-04-2022 16:27
so I set up the simulator and it is conected to the studio but when I press run it says build complete and app installed but it still does not show on the simulator. I might just be putting it in wrong though. could you please be a little more spicific on where I should put it and how I should put it in?
06-04-2022 20:08
06-05-2022 07:13
06-05-2022 07:13
okay, so I got the battery life to work form Fitbit simulator but I still cant get the date to work, or to even show on the simulator.
06-05-2022 07:22
06-05-2022 09:49
06-05-2022 09:49
Hello @track03 , Maybe it doesn’t go to do the battery and the date on the background.
06-05-2022
15:52
- last edited on
06-07-2022
11:29
by
DavideFitbit
06-05-2022
15:52
- last edited on
06-07-2022
11:29
by
DavideFitbit
okay, I will try that.
I almost think that they are behind the back ground.
06-05-2022 16:07
06-05-2022 16:07
@Guy_ says,
well done, it may be working but you may have another field overlaying it.
Try moving it lower down in the definitions and put a console.log message in the code where you assign it.
myDateField.text = new Date().toString();
This is good advice, but it is still not working for me. although, I think I just might not be doing it right.
also witch file or folder thing would I put it into?
Thank you
06-05-2022
22:28
- last edited on
07-19-2024
08:33
by
MarreFitbit
06-05-2022
22:28
- last edited on
07-19-2024
08:33
by
MarreFitbit
@track03- if you make background image first defined element others will display on top.
Try giving date a default text value.
<text id="myDateField" etc....> Default date </text>
Tip, put all your CSS in the SVG, makes it easier to manage the order which is important.
What do you mean by file or folder?
Author | ch, passion for improvement.
06-06-2022 11:33
06-06-2022 11:33
sorry, I mean like the js or css or gui.
06-06-2022 11:42
06-07-2022
06:52
- last edited on
06-07-2022
11:28
by
DavideFitbit
06-07-2022
06:52
- last edited on
06-07-2022
11:28
by
DavideFitbit
okay thank you, I will try.
sorry, do you mean index.gui or widgets.gui.
06-07-2022 06:55 - edited 06-07-2022 06:59
06-07-2022 06:55 - edited 06-07-2022 06:59
Post corrected.
Author | ch, passion for improvement.
06-07-2022 06:58
06-07-2022 06:58
index.gui
Author | ch, passion for improvement.
06-07-2022 07:04
06-07-2022 07:04
@Guy_ sayed-
if you make background image first defined element others will display on top.
Try giving date a default text value.
<text id="myDateField" etc....> Default date </text>
I did this and your advice is giving me the date on the watch face but I only saw it in front of the background once. when the simulator was loading my project it gliched and I could see the date but the background came back and it was gone again. should I take off the background and put it back on? or what should I do?
06-07-2022
07:14
- last edited on
07-19-2024
08:33
by
MarreFitbit
06-07-2022
07:14
- last edited on
07-19-2024
08:33
by
MarreFitbit
@track03 - almost there!
Check your console log for errors
Make sure it's not being incorrectly set, you may see the default value for 1 second and then it is replaced by blank .
Other symptoms
You made it invisible
You made it same colour as background
You made it hidden
Try replacing the calculated value with a constant and see if it stays.
Author | ch, passion for improvement.