I've created a private method to receive a Date, and format it so it looks like "Sunday, August 10, 2014":
private String formatDate(Date date){
java.text.DateFormat dateFormat = android.text.format.DateFormat.getLongDateFormat(getActivity().getApplication());
return dateFormat.format(date);
}
In my fragment's OnCreateView method, I use that method to set a button's text:
mDateButton.setText(formatDate(new Date()));
When I run my app, however, it just says "August 10, 2014." This doesn't make sense to me, since the Android documentation says that getLongDateFormat() should be displaying the day of the week (http://developer.android.com/reference/android/text/format/DateFormat.html#getLongDateFormat(android.content.Context)). Am I using getLongDateFormat() incorrectly?
I'm using Android API Level 19 as my target.