fix: next alarm time follows system 24-hour format setting
getNextAlarm hardcoded 'hh:mm a' (12-hour). Now uses DateFormat.is24HourFormat to pick HH:mm vs hh:mm a.
This commit is contained in:
@@ -264,7 +264,9 @@ class AppHelper @Inject constructor() {
|
||||
if (nextAlarmClock == null) return "No alarm is set."
|
||||
|
||||
val alarmTime = nextAlarmClock.triggerTime
|
||||
val formattedTime = SimpleDateFormat("EEE, MMM d hh:mm a", Locale.getDefault()).format(alarmTime)
|
||||
val is24Hour = android.text.format.DateFormat.is24HourFormat(context)
|
||||
val timePattern = if (is24Hour) "EEE, MMM d HH:mm" else "EEE, MMM d hh:mm a"
|
||||
val formattedTime = SimpleDateFormat(timePattern, Locale.getDefault()).format(alarmTime)
|
||||
|
||||
val drawable = AppCompatResources.getDrawable(context, R.drawable.ic_alarm_clock)
|
||||
val fontSize = TypedValue.applyDimension(
|
||||
|
||||
Reference in New Issue
Block a user