From 276a03735ccd1fe048e3626a1de30e25cd5d4aa7 Mon Sep 17 00:00:00 2001 From: PavelRatushnyi Date: Sat, 9 Sep 2017 19:08:24 +0300 Subject: [PATCH] Format date --- .../HistoryMarkerMenuBottomSheetDialogFragment.java | 6 +++++- .../plus/mapmarkers/adapters/MapMarkersActiveAdapter.java | 5 ++++- .../plus/mapmarkers/adapters/MapMarkersHistoryAdapter.java | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/mapmarkers/HistoryMarkerMenuBottomSheetDialogFragment.java b/OsmAnd/src/net/osmand/plus/mapmarkers/HistoryMarkerMenuBottomSheetDialogFragment.java index 972a44e2bc..6d751f9138 100644 --- a/OsmAnd/src/net/osmand/plus/mapmarkers/HistoryMarkerMenuBottomSheetDialogFragment.java +++ b/OsmAnd/src/net/osmand/plus/mapmarkers/HistoryMarkerMenuBottomSheetDialogFragment.java @@ -19,6 +19,10 @@ import net.osmand.plus.R; import net.osmand.plus.base.BottomSheetDialogFragment; import net.osmand.plus.helpers.AndroidUiHelper; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.Locale; + public class HistoryMarkerMenuBottomSheetDialogFragment extends BottomSheetDialogFragment { public final static String TAG = "HistoryMarkerMenuBottomSheetDialogFragment"; @@ -55,7 +59,7 @@ public class HistoryMarkerMenuBottomSheetDialogFragment extends BottomSheetDialo long markerVisitedDate = arguments.getLong(MARKER_VISITED_DATE); ((TextView) mainView.findViewById(R.id.map_marker_title)).setText(markerName); ((ImageView) mainView.findViewById(R.id.map_marker_icon)).setImageDrawable(getIcon(R.drawable.ic_action_flag_dark, MapMarker.getColorId(markerColorIndex))); - ((TextView) mainView.findViewById(R.id.map_marker_passed_info)).setText(String.valueOf(markerVisitedDate)); + ((TextView) mainView.findViewById(R.id.map_marker_passed_info)).setText(getString(R.string.passed, new SimpleDateFormat("MMM dd", Locale.getDefault()).format(new Date(markerVisitedDate)))); mainView.findViewById(R.id.make_active_row).setOnClickListener(new View.OnClickListener() { @Override diff --git a/OsmAnd/src/net/osmand/plus/mapmarkers/adapters/MapMarkersActiveAdapter.java b/OsmAnd/src/net/osmand/plus/mapmarkers/adapters/MapMarkersActiveAdapter.java index 872a70e7e6..1eabc58101 100644 --- a/OsmAnd/src/net/osmand/plus/mapmarkers/adapters/MapMarkersActiveAdapter.java +++ b/OsmAnd/src/net/osmand/plus/mapmarkers/adapters/MapMarkersActiveAdapter.java @@ -15,8 +15,11 @@ import net.osmand.plus.R; import net.osmand.plus.activities.MapActivity; import net.osmand.plus.dashboard.DashLocationFragment; +import java.text.SimpleDateFormat; import java.util.Collections; +import java.util.Date; import java.util.List; +import java.util.Locale; public class MapMarkersActiveAdapter extends RecyclerView.Adapter implements MapMarkersItemTouchHelperCallback.ItemTouchHelperAdapter { @@ -96,7 +99,7 @@ public class MapMarkersActiveAdapter extends RecyclerView.Adapter