From a348dc36ccb4444954d8771de19ca64bdb568bdc Mon Sep 17 00:00:00 2001 From: Vitaliy Date: Fri, 19 Jun 2020 19:42:24 +0300 Subject: [PATCH] Remove unnecessary date format initialization --- .../plus/mapcontextmenu/builders/SelectedGpxMenuBuilder.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/builders/SelectedGpxMenuBuilder.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/builders/SelectedGpxMenuBuilder.java index 67796e1683..17548f4d72 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/builders/SelectedGpxMenuBuilder.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/builders/SelectedGpxMenuBuilder.java @@ -73,9 +73,11 @@ public class SelectedGpxMenuBuilder extends MenuBuilder { false, null, false, 0, false, false, false, null, false); DateFormat startFormat = SimpleDateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT); - DateFormat endFormat = SimpleDateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT); + DateFormat endFormat; if (OsmAndFormatter.isSameDay(analysis.startTime, analysis.endTime)) { endFormat = SimpleDateFormat.getTimeInstance(DateFormat.SHORT); + } else { + endFormat = SimpleDateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT) } String startEndTimeTitle = app.getString(R.string.shared_string_start_time) + " - " + app.getString(R.string.shared_string_end_time); buildRow(view, getThemedIcon(R.drawable.ic_action_time_start), null, startEndTimeTitle,