Replace getActivity() with context

After some research, I found out that DateFormat.is24HourFormat actually accepts Context.
This commit is contained in:
Marko Stanković
2015-08-20 23:09:10 +02:00
parent 61ab77fe4b
commit 52fb5f9fb0
@@ -55,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, DateFormat.is24HourFormat(getActivity()));
boolean isUsing24HourTime = prefs.getBoolean(SettingsFragment.TIMESTAMPS_24H, DateFormat.is24HourFormat(context));
if (isUsing24HourTime) {
return new SimpleDateFormat(input.toPattern().replace('h', 'H').replaceAll(" a", ""));