日期选取器对话框以显示完整的月份名称



我想在日期选择器对话框中显示完整的月份名称。我已经尝试过很多方法都没有成功,让我知道这是否是任何方法。

目前我有这个:

15, 8月 2014

我想得到什么:

15, 八月 2014

这是我的代码:

private void showDailogfordateEnd(final TextView textView)
{
calendar = Calendar.getInstance();
final int day =calendar.get(Calendar.DAY_OF_MONTH);
int month =calendar.get(Calendar.MONTH);
int year =calendar.get(Calendar.YEAR);
dpd = new DatePickerDialog(ProgressReportActivity.this, android.R.style.Theme_Holo_Dialog_MinWidth ,new DatePickerDialog.OnDateSetListener() {
@Override
public void onDateSet(DatePicker view, int year, int month, int dayOfMonth) {
eday=day;
emonth=month;
eyear=year;
textView.setText(dayOfMonth + "-" + (month+1) + "-" + year);
selcetedMonth=month;
selectedDay=day;
selectedYear=year;
calendar.set(Calendar.DAY_OF_MONTH,day);
calendar.set(Calendar.MONTH,month);
calendar.set(Calendar.YEAR,year);
Date date=calendar.getTime();
SimpleDateFormat simpleDateFormat=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
EndDate=simpleDateFormat.format(date);
SimpleDateFormat simpleDateFormat1=new SimpleDateFormat("yyyy-MM-dd ");
eD=simpleDateFormat1.format(date);
}
}, year,month,day);
//((ViewGroup) dpd.getDatePicker()).findViewById(Resources.getSystem().getIdentifier("month", "id", "android"));
dpd.show();

更改:"yyyy-MM-dd ""yyyy-MMMM-dd "

使用以下代码

SimpleDateFormat simpleDateFormat=new SimpleDateFormat("yyyy-MMMM-dd HH:mm:ss");

最新更新