mirror of
https://github.com/quik-sms/quik.git
synced 2026-11-17 19:38:52 +01:00
Timestamps should follow system 12/24h format
...unless the setting TIMESTAMPS_24H is set.
This commit is contained in:
@@ -3,6 +3,7 @@ package com.moez.QKSMS.common.utils;
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
import android.text.format.DateUtils;
|
||||
import android.text.format.DateFormat;
|
||||
|
||||
import com.moez.QKSMS.QKSMSApp;
|
||||
import com.moez.QKSMS.R;
|
||||
@@ -54,7 +55,7 @@ public abstract class DateFormatter {
|
||||
|
||||
public static SimpleDateFormat accountFor24HourTime(Context context, SimpleDateFormat input) { //pass in 12 hour time. If needed, change to 24 hr.
|
||||
SharedPreferences prefs = MainActivity.getPrefs(context);
|
||||
boolean isUsing24HourTime = prefs.getBoolean(SettingsFragment.TIMESTAMPS_24H, false);
|
||||
boolean isUsing24HourTime = prefs.getBoolean(SettingsFragment.TIMESTAMPS_24H, DateFormat.is24HourFormat(getActivity()));
|
||||
|
||||
if (isUsing24HourTime) {
|
||||
return new SimpleDateFormat(input.toPattern().replace('h', 'H').replaceAll(" a", ""));
|
||||
|
||||
Reference in New Issue
Block a user