theengs / app

Theengs mobile application to read BLE sensors and push data to an MQTT broker
https://app.theengs.io
GNU General Public License v3.0
37 stars 7 forks source link

12/24 hour clock #13

Closed DigiH closed 2 years ago

DigiH commented 2 years ago

Using 12 or 24 hour clock in the preferences text about Dark Mode.

While this ideally would be set by the localised device settings the app is running on, with multi-platform I'm not sure how easy this would be in Qt.

I think we can very safely assume though that if a user selects the Metric unit system they are also familiar, and more importantly, more happy with a 24 time display, while Imperial users, mainly in the US I suppose, will prefer the AM/PM time indication. Also slightly changed the actual text.

Checklist:

emericg commented 2 years ago

This is usually handle with handled with localisation indeed. I guess it needs to be decided if the app is going to be localised or not, because if not that could be handled in the code like in your pull request.

DigiH commented 2 years ago

Thanks, so there is the possibility to set these two times in a localised format taking the time format preferences from all platforms easily.

Something like this

"Dark mode will automatically be active between format.timeStyle(21:00) and format.timeStyle(9:00)." or more Qt like, thought expectedly not totally correct from my side ;)

text: qsTr("Dark mode will automatically be active between QTime::fromString("21:00", QLocale().timeFormat(QLocale::ShortFormat)) and QTime::fromString("9:00", QLocale().timeFormat(QLocale::ShortFormat)).") 

even for only English?

Similar to how the localised date is taken from the system locale settings in the charts .qmls

DigiH commented 2 years ago

Closing as this hopefully will be integrated with device specific formatting, and possibly even adhering to device specific dark mode times.