rahim / nightwear

NightScout standalone Wear 2.0 watchface and complication
GNU General Public License v3.0
12 stars 9 forks source link

Watchface: ability to change clock to 12h vs 24h #12

Closed tswire closed 2 years ago

tswire commented 5 years ago

Is this a hard coded setting? Can it be an option like mmol?

tswire commented 5 years ago

Hey Rahim, any update on the above? I am trying to learn my way through some of this build to hopefully help get it to full complication status which will be very useful for many of us on iPhone with Android Wear watch!

rahim commented 3 years ago

Sorry for the lack of response here (2 years!) - very much open to this as a preferences option, it was long on my list of potential enhancements.

The complication implementation has since been added and is easily extended.

itsdiabetes commented 2 years ago

Is this feature available in the downloadable version from Google Play? If so, how does one change from 24hr to 12hr? Thank you in advance.

rahim commented 2 years ago

Hi @itsdiabetes - this is a feature request ticket, unfortunately this isn't implemented yet - I'll count your comment as another vote for this, it shouldn't be hard to add.

itsdiabetes commented 2 years ago

Wouldn't you simply edit Line 206 of NightWearDigitalFace.kt to be "mCalendar.get(Calendar.HOUR)," instead? I don't see the necessity to differentiate AM/PM due to the fact you'll know if it's sunlight outside or not outside of niche cases*. To make it more human readable, L205 could be changed to remove the second figure by modifying it to "%02d:%02d".

I know there would be more work as you would likely want to make this a setting rather than hard-coded. If you really wanted to get fancy, you could automatically adapt it such that when a person opts for "mg/dL" it will change to the 12-hour format. The US (12-hour exclusively), France (12-hour & 24-hour interchangeable), Japan (12-hour & 24-hour interchangeable), Israel (no good data, but Microsoft Windows uses a 24-hour clock), and India (12-hour primarily) are the primary nations for using mg/dL. However, because of Israel, there should be an option for 12-hour OR 24-hour.

rahim commented 2 years ago

@itsdiabetes I wouldn't add this without a configuration option - purely because I personally use 24hr clock everywhere by preference.

Another fancy option (that I'd contemplated for the units setting) is defaulting based on what's set in the nightscout instance. I'm not sure how much of that is actually exposed by API.

Even with a new config option, the code changes should be small as you've identified - the bulk of the effort is standing up a fresh development environment, testing and then shepherding a new release through the play store.

rahim commented 2 years ago

A 12hr clock configuration option is now available in the latest version in the Play store (1.1.7)