Timestamps should follow system 12/24h format

...unless the setting TIMESTAMPS_24H is set.
This commit is contained in:
Marko Stanković
2015-08-20 22:50:30 +02:00
parent db38994325
commit 61ab77fe4b
@@ -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", ""));