diff options
author | Eric Fischer <> | 2009-03-24 18:30:27 -0700 |
---|---|---|
committer | The Android Open Source Project <initial-contribution@android.com> | 2009-03-24 18:30:27 -0700 |
commit | e55255bf9b51997f75b954126093c1074e981c48 (patch) | |
tree | c52b946ee0f69a705caa37506c2e453cc3499121 /core | |
parent | 41bba26eed18c0c5f49432945afa75d6c2ba9295 (diff) | |
download | frameworks_base-e55255bf9b51997f75b954126093c1074e981c48.zip frameworks_base-e55255bf9b51997f75b954126093c1074e981c48.tar.gz frameworks_base-e55255bf9b51997f75b954126093c1074e981c48.tar.bz2 |
Automated import from //branches/master/...@140785,140785
Diffstat (limited to 'core')
-rw-r--r-- | core/java/android/app/DatePickerDialog.java | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/core/java/android/app/DatePickerDialog.java b/core/java/android/app/DatePickerDialog.java index ee5e0d5..863cbcc 100644 --- a/core/java/android/app/DatePickerDialog.java +++ b/core/java/android/app/DatePickerDialog.java @@ -47,6 +47,7 @@ public class DatePickerDialog extends AlertDialog implements OnClickListener, private final OnDateSetListener mCallBack; private final Calendar mCalendar; private final java.text.DateFormat mDateFormat; + private final java.text.DateFormat mTitleDateFormat; private final String[] mWeekDays; private int mInitialYear; @@ -108,6 +109,8 @@ public class DatePickerDialog extends AlertDialog implements OnClickListener, mWeekDays = symbols.getShortWeekdays(); mDateFormat = DateFormat.getMediumDateFormat(context); + mTitleDateFormat = java.text.DateFormat. + getDateInstance(java.text.DateFormat.FULL); mCalendar = Calendar.getInstance(); updateTitle(mInitialYear, mInitialMonth, mInitialDay); @@ -126,7 +129,7 @@ public class DatePickerDialog extends AlertDialog implements OnClickListener, @Override public void show() { super.show(); - + /* Sometimes the full month is displayed causing the title * to be very long, in those cases ensure it doesn't wrap to * 2 lines (as that looks jumpy) and ensure we ellipsize the end. @@ -160,8 +163,7 @@ public class DatePickerDialog extends AlertDialog implements OnClickListener, mCalendar.set(Calendar.YEAR, year); mCalendar.set(Calendar.MONTH, month); mCalendar.set(Calendar.DAY_OF_MONTH, day); - String weekday = mWeekDays[mCalendar.get(Calendar.DAY_OF_WEEK)]; - setTitle(weekday + ", " + mDateFormat.format(mCalendar.getTime())); + setTitle(mTitleDateFormat.format(mCalendar.getTime())); } @Override |