asteroid-launcher
asteroid-launcher copied to clipboard
TimeZone Support
I am not really sure if this is the right repo to open this on. It kind of spans this one, the btsynd and the android app etc, so let me know if I should move it. Also sorry for the brain-dump issue, I wanted to write it down before I forgot it all :grin:
It would be awesome if AsteroidOS grew support for timezones, so watchfaces could display times in multiple timezones etc.
Currently what I think is the case is that the watch has whatever localtime is set as UTC. This is obviously a problem as soon as you want to start calculating the times in other places, so I think the first thing to do is to enable the user to set their current timezone. This can be done either through time synchronisation through the BT service [1] or via the settings app / startup thing.
There is a list of timezones already on the watch in /usr/share/zoneinfo
or the output of timedatectl list-timezones
I don't know if this info is exposed through timed or any of the qt libs in a way that it could be neatly presented to the user in a UI. (I would think it would be better to present multiple screens for timezone selection (filter by region) than one gigantic list.)
From my limited research it looks like once the local time has a timezone associated with it it would then be possible in the watchfaces to ask for the wallclock time in a different timezone.
[1] It looks like the android app at least has access to the timezone of the phone, so it could be sent across along with the date and time here and then it looks like the timed lib also supports setting timezone manually, but I have struggled to find any documentation on timed.
Thanks for the suggestion and braindump Cadair!
I wanted to reference the comments I left on IRC yesterday: https://log.asteroidos.org/?date=2018-06-09&level=16#79 Long story short: I don't think we want to implement timezones support systemwise because it would most likely make the watch experience too complex without any reason for most usecases. If your watchface requires timezone information, I would prefer if the watchface itself could be configured for two different timezones.
That being said, if you come up with an example where timezones would justify the addition of complex settings pages, I would consider the change.
Also, you mentioned that the info could be sent via BT. This is correct and easy to implement, but one of the goal of Asteroid is to be usable even without a phone. Do you think it makes sense to have settings only available on the phone and not on the watch? Similar problems have blocked other complex usecases (eg: entering WLAN passwords...)
One use case I'm currently bumping into is that, having written a TOTP 2FA app for AsteroidOS, I do need to know the time in the correct time zone to have the correct code displayed. (I'm not proud of how long it took me to figure this out!) I'm tinkering to see if I can figure out how to set the time zone conveniently---for now I just updated the timezone manually with timedatectl
. I might see if I can get a decent UI hacked together in the settings app though, and I'd be interested in opinions on that!
I have encountered another use case for timezone support. In importing an .ics
(calendar) file into the watch to be able to display appointments, knowing and using the correct timezone is required to be able to correctly display the times and dates.
We now have timezone support!