04-25-2020 07:45
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

SunsetRunner
04-25-2020 07:45
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
I made a Watch Face with a time (Example:09:30), a battery level(Example:100%), and a date (Example: APR 25, SAT). Let's say the battery level is 100%. It goes down one, but the Clockface doesn't say 99% it says 100% still... Or today it may say APR 25, SAT and the next day it will still say APR 25, SAT.
My question: Is there a way for the Clock Face to refresh every few seconds.
I need it to refresh so the date and the battery level is accurate.
(At the time of posting this the date is APR 25, SAT)This morning it still said APR 24, FRI, I had to change to a different Clock Face then change back to mine, and then it showed the correct date and battery level.
Here is my index.js:
import clock from "clock";
import document from "document";
import { preferences } from "user-settings";
import * as util from "../common/utils";
import { battery } from "power";
import userActivity from "user-activity";
import { goals, today } from "user-activity";
// The real scripts
const myLabel = document.getElementById("myLabel");
const batteryHandle = document.getElementById("batteryLabel");
const txtDate = document.getElementById("date");
let date = new Date();
let month = nameOfMonth(date.getMonth());
let dayofweek = nameOfDayweek(date.getDay());
let day = date.getDate();
txtDate.text = `${month} ${day}, ${dayofweek}`;
clock.granularity = "minutes";
clock.ontick = (evt) => {
let today = evt.date;
let hours = today.getHours();
if (preferences.clockDisplay === "12h") {
//12 hour format
hours = hours % 12 || 12;
} else {
// 24h format
hours = util.zeroPad(hours);
}
let mins = util.zeroPad(today.getMinutes());
let today = new Date();
myLabel.text = `${hours}:${mins}`;
}
function nameOfMonth(i) {
switch(i) {
case 0:
return "JAN";
case 1:
return "FEB";
case 2:
return "MAR";
case 3:
return "APR";
case 4:
return "MAY";
case 5:
return "JUN";
case 6:
return "JUL";
case 7:
return "AUG";
case 8:
return "SEP";
case 9:
return "OCT";
case 10:
return "NOV";
case 11:
return "DEC";
}
}
function nameOfDayweek(i) {
switch(i) {
case 0:
return "SUN";
case 1:
return "MON";
case 2:
return "TUE";
case 3:
return "WED";
case 4:
return "THUR";
case 5:
return "FRI";
case 6:
return "SAT";
case 7:
}
}
// Battery Measurement
let batteryValue = battery.chargeLevel;
// Assignment value battery
batteryHandle.text = ` ${batteryValue} %`;
Answered! Go to the Best Answer.

Accepted Solutions
04-25-2020 13:08
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

SunsetRunner
04-25-2020 13:08
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
FOUND It out

04-25-2020 08:14
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

SunsetRunner
04-25-2020 08:14
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
If you're familiar with the Fitbit OS Sim, what I need is like an "auto-launch."

04-25-2020 13:08
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

SunsetRunner
04-25-2020 13:08
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
FOUND It out

