List Timezones for user selection #53
Replies: 3 comments 8 replies
-
(Just to give more context to anyone else who happens to come along to read this, we are moving the discussion in #51 to here.) Comments about your timezone-test.ino Sample Code Your sample code that you posted above is generally on the right path. I have a few comments about your usage of some of the AceTime classes:
General Comments about TimeZones Menus As I mentioned in #51, the problem of how to display the full list of timezones to the end-user is a difficult problem.
I think the appropriate solution depends on the type of UI that is presented to the user. For example, the solution on a small OLED display will need to be different than on an HTML web page. My own personal projects have not needed to display the entire timezone collection, so my thoughts on this are preliminary and unpolished, but here they are: It seems like there are roughly 2 ways to sort such a large collection:
In terms of implementation, a list of timezones ordered in some way for the purposes of UI will require another array:
So that's about 1300 bytes for the 266 zones in the In terms of code structure, I think information related to how the time zones are presented to the user should live somewhat outside of the core AceTime library. Maybe in another C++ namespace. Maybe even in another library that is layered on top of AceTime. Anyway, these are some of the ideas bouncing around in my mind for a while. Hope this helps. |
Beta Was this translation helpful? Give feedback.
-
Hi, I scanned your code at https://github.com/YarekTyshchenko/KJ-8/blob/master/timezone-test/timezone-test.ino. The AceTime related code looks much better.
Some thoughts on the sorting problem:
|
Beta Was this translation helpful? Give feedback.
-
Just want to mention that I released v1.9.0 yesterday. This version provides the ability to sort zones. Two implementations are provided, implementing sorting in 2 different ways:
These classes rely on the new AceSorting library. I chose to use the Shell Sort algorithm for these classes. It has a complexity of about The ZoneSorter classes seem to consume between 200-600 bytes of program flash, depending on the microcontroller architecture. Please note that I made several breaking changes from v1.7.0 (when this discussion started) and the current v1.9.0 version. See the CHANGES.md file, the README.md, and the MIGRATING.md guide. The AceTime library is now split into 2 user-facing libraries: AceTime and AceTimeClock. |
Beta Was this translation helpful? Give feedback.
-
I want to use the
zonedb
as a source of selecting a timezone, during wireless configuration. The ZoneDB list is so complete, and so very well packed, it seems a waste to create a reduced list to select from.I'm currently just plugging various libraries together, AutoConnect's
Simple.ino
example, which already includes a timezone selection list, trying out the idea of streaming stored timezone names out to the browser:https://github.com/YarekTyshchenko/KJ-8/blob/master/timezone-test/timezone-test.ino
The idea of this project is to create a generic base for various clocks that I'm building, providing them with fully automated operation, without any hardware buttons or anything like that.
Beta Was this translation helpful? Give feedback.
All reactions