Merge "Dark theme time format"
This commit is contained in:
@@ -25,13 +25,14 @@ import java.time.format.DateTimeFormatter;
|
|||||||
*/
|
*/
|
||||||
public class TimeFormatter {
|
public class TimeFormatter {
|
||||||
private final Context mContext;
|
private final Context mContext;
|
||||||
public static DateTimeFormatter formatter = DateTimeFormatter.ofPattern("hh:mm a");
|
private final DateTimeFormatter mFormatter;
|
||||||
public TimeFormatter(Context context) {
|
public TimeFormatter(Context context) {
|
||||||
mContext = context;
|
mContext = context;
|
||||||
|
mFormatter = DateTimeFormatter.ofPattern("hh:mm a");
|
||||||
}
|
}
|
||||||
|
|
||||||
public String of(LocalTime time) {
|
public String of(LocalTime time) {
|
||||||
return is24HourFormat() ? time.toString() : formatter.format(time);
|
return is24HourFormat() ? time.toString() : mFormatter.format(time);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean is24HourFormat() {
|
public boolean is24HourFormat() {
|
||||||
|
Reference in New Issue
Block a user