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) {
Time time = new Time();
time.set(timeInMillis);
SimpleDateFormat sdf = new SimpleDateFormat("HH:mm dd.MM.yyyy", Locale.getDefault());
if (!DateFormat.is24HourFormat(app)) {
sdf = new SimpleDateFormat("hh:mm a dd.MM.yyyy", Locale.getDefault());
}
return sdf.format(new Date(time.toMillis(false)));
java.text.DateFormat dateFormat = DateFormat.getMediumDateFormat(app);
java.text.DateFormat timeFormat = DateFormat.getTimeFormat(app);
return timeFormat.format(timeInMillis) + " " + dateFormat.format(timeInMillis);
}
String getFormattedTimeInterval(long timeInMillis, Activity ctx) {