settings.js: wrap time #1872
Replies: 11 comments
-
Posted at 2020-06-06 by Humpelstilzchen Looks like there is no two-way-binding between both. I guess the wrapping needs to be done in E.showMenu(). But you do know that you can easily set the time from gps or from the "About"-Tab in the app loader? |
Beta Was this translation helpful? Give feedback.
-
Posted at 2020-06-07 by NebbishHacker I think that code will just get stuck at -1 and 24. This should work a bit better (untested):
As for why you aren't seeing your changes - a bit of a long shot, but you could be running into this issue. If that's the case, upgrading to a newer firmware version should help. Also, I assume you're using the espruino IDE to upload your changes to the watch? You might find it more convenient to clone the repository locally and test your changes using either apploader.js or a local server, as discussed in this thread. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2020-06-08 by FransM @Humpelstilzchen I expect the configuration only to be done using min and max, as the code to set the minutes uses the same mechanism. Wrt gps time: that is nice, but does not work that well when you are inside and need a forced reboot. @nebbishhacker I tried my changed settings on the phone by updating settings.js but that did not change things, not even after a reboot. It did not get stuck . |
Beta Was this translation helpful? Give feedback.
-
Posted at 2020-06-08 by @gfwilliams
It does - the GPS remembers the time regardless of whether it has signal or not. You just need to have got a GPS lock once, then you can reboot as many times as you want regardless of where you are and it'll update fine.
Did you do 'install default apps' or 'remove all apps' after updating the firmware? If you were using the old firmware and the storage got corrupt then you'd still see the same issue until you cleared the storage and fixed it - it just won't happen again with the new firmware. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2020-06-08 by Humpelstilzchen Btw is there a way to automatically set the time as soon as the watch gets a gps fix? |
Beta Was this translation helpful? Give feedback.
-
Posted at 2020-06-08 by FransM @Humpelstilzchen I think gps time does this? @gfwilliams I can confirm that after a reboot I got the gps time again. Maybe it was due to the firmware upgrade that it lost the time. I did not install default apps or so after the firmware update. Will do so later today and report back. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2020-06-08 by Humpelstilzchen I mean automatically, without any manual intervention. e.g. when using the gps recorder the clock does set the time without me having to press any additional buttons. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2020-06-08 by @gfwilliams
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 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 I'll push a change in a few minutes with this fixed - and the wrapping added |
Beta Was this translation helpful? Give feedback.
-
Posted at 2020-06-08 by FransM @gfwilliams Thanks for the patch to add wrapping. Actually it is possible to create invalid dates like Feb 30 or Jun 31 but I feel it is not really worth the effort to "fix" that. Introducing the number of days per month is easy but then come leap years, someone with a date like Jan 30, moving Jan to Feb (and 30 becomes invalid). Edit: LOL you're quick, my pull request was already merged before I finished typing this message :-) |
Beta Was this translation helpful? Give feedback.
-
Posted at 2020-06-08 by @gfwilliams Thanks! Actually I think if you put an invalid date in, Espruino will just magically convert it to the next valid day, so it's no big deal. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2020-06-08 by Humpelstilzchen
I will just code a widget then. It will update the Bangle time from GPS every time it has a valid fix. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2020-06-05 by FransM
I was a bit annoyed that when setting the time the hours did not wrap.
So when going up it would stuck at 23 instead of wrapping to 0 and when going down it would be stuck at 0.
I tried to change this by modifying the Hour section of showSetTimeMenu in settings.js to this:
I thought that would to the trick but to no avail.
I did overwrite settings.js on the bangle; that did not work, then I rebooted but still no luck.
I've read back settings.js to verify that it is actually the modified version and it is.
What am I doing wrong ???
Beta Was this translation helpful? Give feedback.
All reactions