-
• #2
Ok, what you're after looks like it's similar to some other clock apps - for example https://banglejs.com/apps/?id=worldclock (there are some others, like https://banglejs.com/apps/?q=zone)
Those use a 'customiser' page on the app loader to let you configure them from the App Loader (https://www.espruino.com/Bangle.js+Custom)
You can check the code out at https://github.com/espruino/BangleApps/tree/master/apps/worldclock but basically:
- An HTML file that runs in the app loader lets you configure timezones: https://github.com/espruino/BangleApps/blob/master/apps/worldclock/custom.html
- They are written to a file on the watch into called
worldclock.settings.json
- The clock loads the data using
data = require("Storage").readJSON("worldclock.settings.json")
is Bangle.js aware of timezones and daylight savings?
It's not enabled by default, but if you install https://banglejs.com/apps/?id=widdst then yes it is
- An HTML file that runs in the app loader lets you configure timezones: https://github.com/espruino/BangleApps/blob/master/apps/worldclock/custom.html
-
• #3
Never Mind - I found the solution. Just can't delete this post.
"Configuration data for a watch face?" I hear you asking. Am I crazy? Maybe not. Here's the use case. I have a watch face that I'm working on that includes the display of the time in another timezone.
I personally find it very useful, because I have relatives spread across Europe, family in both England and Switzerland. So it's handy to know what time it is there before sending a text and waking them up at 3:00 AM local time.
The config data is pairs of values:
[
{ "name": "LON", "offset": 480 },
{ "name": "ZUR", "offset": 560 }
]
is how it would be represented in JSON. You can work out from these that I live on the west coast of the USofA. What I need is a way for the watch face to get this data, presumably via BLE, and then save it to some sort of persistent storage that will survive across a restart of the watch face.
There's enough information about BLE that I can probably figure that out myself, but I'm at a complete loss as to how to save data permanently in a form that a watch face can access.
On a very closely related topic, is Bangle.js aware oft timezones and daylight savings? Meaning if I tell it that I live in the america/los_angeles timezone, does it know how to change itself every March and November, without needing a connection to a compter or phone?