Btw is there a way to automatically set the time as soon as the watch gets a gps fix?
There's the 'GPS Time' app that makes it easy - or you could just hold BTN1+BTN3 to reboot and it'll pull it in then...
@FransM yes, wrapping time sounds like a great idea. Personally, I'd forget about min/max and do:
'Hour': { value: d.getHours(), onchange: function(v) { this.value = (v+24)%24; d = new Date(); d.setHours(this.value); setTime(d.getTime() / 1000); } },
The (v+X)%X pattern is really neat - I'll have to use that in future.
(v+X)%X
Having said all that, the current 'set time' menu looks very broken to me (time keeps moving the background but the menu doesn't!).
For example if you set 12:59 and then wait a minute, then change the minutes again, the menu will show 12:59 but the time will be 13:59.
12:59
13:59
I'll push a change in a few minutes with this fixed - and the wrapping added
@Gordon started
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
There's the 'GPS Time' app that makes it easy - or you could just hold BTN1+BTN3 to reboot and it'll pull it in then...
@FransM yes, wrapping time sounds like a great idea. Personally, I'd forget about min/max and do:
The
(v+X)%X
pattern is really neat - I'll have to use that in future.Having said all that, the current 'set time' menu looks very broken to me (time keeps moving the background but the menu doesn't!).
For example if you set
12:59
and then wait a minute, then change the minutes again, the menu will show12:59
but the time will be13:59
.I'll push a change in a few minutes with this fixed - and the wrapping added