Capitalize first letter in month

This commit is contained in:
PavelRatushny 2017-09-22 15:17:43 +03:00
parent 6e2e61bd2e
commit 546c6c18a8

View file

@ -151,7 +151,13 @@ public class MapMarkersActiveAdapter extends RecyclerView.Adapter<MapMarkerItemV
descr = mapActivity.getString(R.string.shared_string_favorites);
}
} else {
descr = new SimpleDateFormat("MMM dd", Locale.getDefault()).format(new Date(marker.creationDate));
Date date = new Date(marker.creationDate);
String month = new SimpleDateFormat("MMM", Locale.getDefault()).format(date);
if (month.length() > 1) {
month = Character.toUpperCase(month.charAt(0)) + month.substring(1);
}
String day = new SimpleDateFormat("dd", Locale.getDefault()).format(date);
descr = month + " " + day;
}
holder.description.setText(descr);