Respect system preference for 24 hour time

This commit is contained in:
Moez Bhatti
2016-07-07 13:57:03 -04:00
parent dcf9cfd74d
commit 09a8b3864e
7 changed files with 2 additions and 27 deletions
@@ -1,9 +1,6 @@
package com.moez.QKSMS.common.utils;
import android.content.SharedPreferences;
import android.preference.PreferenceManager;
import android.test.AndroidTestCase;
import com.moez.QKSMS.ui.settings.SettingsFragment;
import java.text.SimpleDateFormat;
@@ -12,13 +9,6 @@ public class DateFormatterTest extends AndroidTestCase {
super.setUp();
}
public void test24Hours() {
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext());
prefs.edit().putBoolean(SettingsFragment.TIMESTAMPS_24H, true).apply();
assertTrue(DateFormatter.accountFor24HourTime(getContext(), new SimpleDateFormat("h:mm a")).equals(new SimpleDateFormat("H:mm")));
prefs.edit().putBoolean(SettingsFragment.TIMESTAMPS_24H, false).apply();
}
public void testDateSymbolsAPI(){
assertEquals(new SimpleDateFormat("H:mm a").toPattern(), "H:mm a");
}