sqfmi / Watchy

Watchy - An Open Source E-Ink Smartwatch
http://www.sqfmi.com
MIT License
2k stars 334 forks source link

How to use 12 hour time? #163

Open synthead opened 2 years ago

synthead commented 2 years ago

Is there a way to use 12h time with Watchy without writing something myself?

I don't see anything about this in the documentation, so I thought I'd file an issue and ask.

bushmango commented 2 years ago

Here's some code from the 7SEG example that may help:

void Watchy7SEG::drawTime(){ display.setFont(&DSEG7_Classic_Bold_53); display.setCursor(5, 53+5); int displayHour; if(HOUR_12_24==12){ displayHour = ((currentTime.Hour+11)%12)+1; } else { displayHour = currentTime.Hour; } if(displayHour < 10){ display.print("0"); } display.print(displayHour); display.print(":"); if(currentTime.Minute < 10){ display.print("0"); } display.println(currentTime.Minute); }

synthead commented 2 years ago

I was hoping to find some kind of way to set this without doing it myself, but it looks like Watchy doesn't have native support to do this.

It would be great to have a setting in the menu, and maybe something lie currentTime.Is12Hour available to the faces. Maybe even have currentHour.Hour12 and currentHour.IsPM helper functions, too.

This approach has these benefits:

KidElectric commented 2 years ago

I agree that this should be a setting in the menu and at the very least ... a setting in the settings.h file? choosing 12 vs. 24 hour strikes me as a fundamental feature for digital watch faces. unlike a dial watch, you don't know a priori what the base is until after noon on any given day unless it is a feature or setting. so this can be confusing.