What's the best way to handle a long list in settings?

Hello,

What's the best way to handle a long list in settings?

I am making a watch face where the user can select a time zone or Zulu offset.  There are over 30 different time zones around the globe and I'd rather not do a super long list.  Mainly because I'd have to create over 30 items in the list, then re-create this in strings.  Any thoughts?

I've considered doing 5 different number entries (1st for plus or minus, 2nd & 3rd for hours, 4th and 5th for minutes), but I have no say in the formatting of the settings page (other than <group>) to make it look obvious.  

I tried asking for the hours separate from the minutes (constrained with min-max), but i don't think it was clear what I was looking for.

I could ask for the time zone as a string and then reference a database, but then I'd have to create and maintain a database of currently 117 time zones (https://www.worlddata.info/timezones/index.php).

Thoughts?

Top Replies

All Replies

  • I'm saying that I wish there was a way for CIQ to query the tzmap data on a Garmin device.  I requested that years ago, as this whole thing can be confusing, and needs constant updates as the rules change.

    Doesn't it make sense that there was a way to say "at this lat/lon, what is the time?" 

    How many people will update their CIQ apps regularly just because of rule changes?

    In the US, the debate about country wide one time year round has been going on since the 70's.  One year, during the energy crisis, they kept  the same time for the whole year, and people hated it.  I was a kid in the upper midwest at the time.  Walking home from school when it was pitch black..

  • No, we are in Mountain time but don't do DST, and US/AZ was added to computers to make it easier for people to select.

  • 'm saying that I wish there was a way for CIQ to query the tzmap data on a Garmin device.  I requested that years ago, as this whole thing can be confusing, and needs constant updates as the rules change.

    Doesn't it make sense that there was a way to say "at this lat/lon, what is the time?" 

    As I already pointed out in this thread, CIQ System 5 actually has this now.

    It's called LocalMoment

    https://developer.garmin.com/connect-iq/api-docs/Toybox/Time/LocalMoment.html

    A LocalMoment is an immutable moment in time.

    LocalMoment represents a single point in time at a specific location. It differs from Moment in that it also keeps time zone information in addition to the time.

    This doesn't solve the problem of having the user manually select a "time zone + DST rules" entry, for a location other than their current location. You still have to manually enumerate a list of "time zones" which are actually "time zone + DST rules", so your list will include "Mountain Time", "Arizona", etc. If the rules for CO (+ 4 other Mountain Time states) change next year, you'll have to add an entry for "Colorado, ...".

  • No, we are in Mountain time but don't do DST, and US/AZ was added to computers to make it easier for people to select.

    Cool so you admit that what computers call a "time zone" is not the same as what the average person calls a "time zone". And you implicitly agree that if you were to manually select a "time zone" in a CIQ app which needs to automatically handle DST changes, you would use the computer definition of a "time zone", not the "human definition".

    You also admit that when you said "no, Windows asks you to select a time zone", you were wrong given your narrow definition of "time zone" where AZ and CO are both in the same Mountain Time Zone.

    Glad we all finally agree.

  • Honestly we're just being trolled because Jim perfectly understands how it works, he just insists on purposely misunderstanding what people mean when they say "I want to let users manually select a time zone in my app" and "windows allows you to manually select a time zone."

    This is happening despite the fact that he knows very well that Windows and other systems have separate "time zone" entries for Arizona, Hawaii, etc. (which are not "literally time zones").

  • No, windows and others (as well as attomic clocks) know the TZ, and have a switch for DST.

    Have you actually used LocalMoment?  Based on the API doc, it may not do what you think.

  • It is not for just computers it is for all of us who want to talk about the same thing. Timezones weren't invented for computers, it was to support long distance travel and the fact that the sun sets and rises at different times between two locations.

    When we talk about this US/Mountain in Arizona and we look it up and we see ahhh, ok, it is actually US/Arizona because of these rules. We can now distinguish between the two when we talk. Except for you, because you are stuck in your ways. So for you we have to say, "US/Mountain without DST" where Flow and I can just say US/Arizona. When I have meetings with my co-workers I can tell them 10 am America/Aruba time and they can input that in their calender and it becomes 4pm Europe/Amsterdam. Now if I were to speak to you, I would say 7am US/Arizona and you would look me in the eyes and don't understand me. I would say the same to Flow, and Flow would understand me. Communication depends on a clear understanding of concepts so we both know we are talking about the very same thing. That's why we have timezones (among other reasons). You sticking your head in the sand and plugging your ears is making sure we can never talk about the same thing, ever.

    I hope somewhere this weekend you'll allow yourself to accept these new facts and change your stance.

  • No, windows and others (as well as attomic clocks) know the TZ, and have a switch for DST.

    Oh so now we're back to being objectively wrong instead of just arguing semantics.

    I already posted a GIF where selecting "Mountain Time" vs. "Arizona" in the windows time zone list causes the clock time to change by one hour. The only possible way this could happen is if the appropriate DST rules are associated which each of those entries.

    The DST configuration switch in Windows is for *automatically* adjusting the time based on DST, not manually stating that DST is in effect or not. Do you think that someone who lives in Denver has to change a windows setting manually when DST starts and ends?

    How do you think windows *automatically* adjusts for DST? Given that my Windows PC doesn't know where I am (location services are off), I'm 100% sure that it uses the "time zone" that I selected.

    I'm starting to think maybe the reason you don't understand this is because you live in Arizona and DST doesn't apply there.

    Have you actually used LocalMoment?  Based on the API doc, it may not do what you think.

    I just went by what the doc says.

    "A LocalMoment is an immutable moment in time.

    LocalMoment represents a single point in time at a specific location. It differs from Moment in that it also keeps time zone information in addition to the time."

    And the code example:

    // This code will print the following
    // to the console:
    // 2018-02-23 18:12:00
    // day_of_week=6 month=2
    // day_of_week=Fri month=Feb
    
    // Saturday Feb 24th, 2018 12:12am UTC
    var options = {
        :year   => 2018,
        :month  => 2,
        :day    => 24,
        :hour   => 0,
        :min    => 12
    };
    
    var when = Gregorian.moment(options);
    
    var where = new Position.Location({
        :latitude  =>  38.85391,
        :longitude => -94.79630,
        :format    => :degrees,
    });
    
    var local = Gregorian.localMoment(where, when);
    
    var info = Gregorian.info(local, Time.FORMAT_SHORT);
    
    // Friday Feb 23th, 2018 6:12pm
    Sys.println(Lang.format("$1$-$2$-$3$ $4$:$5$:$6$", [
        info.year.format("%04u"),
        info.month.format("%02u"),
        info.day.format("%02u"),
        info.hour.format("%02u"),
        info.min.format("%02u"),
        info.sec.format("%02u"),
    ]));
    

    Sounds like it does exactly what you want.

    Given UTC time and a location, it determines the local time at that location, as well the time zone offset and whether DST is in effect or not. How is that not "querying the tzmap" for a given location?

  • The atomic clock knows nothing about timezones, it just ticks at one second intervals. Because a second is a clearly defined unit of measurement.

    We, humans, than assign that time to a given location with the timezone information attached to it so we can use clocks to synchronize our actions.