Update ParkingPositionPlugin.java

This commit is contained in:
sampledevcode 2020-08-05 14:09:18 +03:00
parent 7567a1b3ae
commit 4785845d3b

View file

@ -526,13 +526,9 @@ public class ParkingPositionPlugin extends OsmandPlugin {
} }
String getFormattedTime(long timeInMillis) { String getFormattedTime(long timeInMillis) {
Time time = new Time(); java.text.DateFormat dateFormat = DateFormat.getMediumDateFormat(app);
time.set(timeInMillis); java.text.DateFormat timeFormat = DateFormat.getTimeFormat(app);
SimpleDateFormat sdf = new SimpleDateFormat("HH:mm dd.MM.yyyy", Locale.getDefault()); return timeFormat.format(timeInMillis) + " " + dateFormat.format(timeInMillis);
if (!DateFormat.is24HourFormat(app)) {
sdf = new SimpleDateFormat("hh:mm a dd.MM.yyyy", Locale.getDefault());
}
return sdf.format(new Date(time.toMillis(false)));
} }
String getFormattedTimeInterval(long timeInMillis, Activity ctx) { String getFormattedTimeInterval(long timeInMillis, Activity ctx) {