Closed dessalines closed 2 months ago
👋 Thanks for reporting!
We will get back to you soon about this issue.
just a quick question. are using 12 or 24 hour clock?
12 hour, but notably OLauncher also uses the 12-hour, but still removes the AM/PM.
ya just having a look and they don't seem to support format24Hour on there clock at all.
<TextClock
android:id="@+id/clock"
style="@style/TextDefault"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="sans-serif-light"
android:format12Hour="h:mm"
android:textSize="@dimen/time_size"
tools:text="02:34" />
<TextView
android:id="@+id/date"
style="@style/TextDefault"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:format12Hour="EEE, dd MMM"
android:format24Hour="EEE, dd MMM"
android:paddingHorizontal="3dp"
android:textSize="@dimen/date_size"
tools:text="Thu, 30 Dec" />
I could add a toggle for this in the settings as myself i like to see the AP/PM as I use a 12 hour clock.
Ok so i added a toggle and the toggle does nothing they both display the same as that is timezone dependent some timezones show ap/pm and some dont. the a
doesnt seem to make any difference at all. i would need to also add a toggle for using timezone or not for this to work.
Any ideas would be helpful.
val best12 = if (prefs.showTimeFormat) {
DateFormat.getBestDateTimePattern(timezone, "hhmma")
} else {
DateFormat.getBestDateTimePattern(timezone, "hhmm")
}
You'll probably have to do this based on locale, not timezone, and just use SimpleDateFormat, as this answer recommends:
https://stackoverflow.com/a/63135372
Here's another more recent answer:
I have found a better way as both of them examples are using java I use Kotlin
val best12 = DateFormat.getBestDateTimePattern(timezone, if (prefs.showTimeFormat) "hhmma" else "hhmm").let {
if (!prefs.showTimeFormat) it.removeSuffix(" a") else it
}
I'm on version 1.6.2 and it always shows me time in 12hr format, regardless of am/pm toggle. System wide I have 24hr clock
Checklist
Feature description
OLauncher looks like it removes the AM/PM by default. It looks cleaner, and makes sense to do. You could make this optional / a setting, but IMO its not necessary. Not even the android top bar shows AM/PM.
Additional information
NA
Terms and Conditions