am 5220834c: Merge "Down arrow on the month can end up at the start of the month" into honeycomb

* commit '5220834c6ccdabf949dfe7160548ad378850d71b':
  Down arrow on the month can end up at the start of the month
This commit is contained in:
Svetoslav Ganov
2011-01-11 18:06:46 -08:00
committed by Android Git Automerger

View File

@@ -514,10 +514,11 @@ public class DatePicker extends FrameLayout {
* inconsistent date the values are normalized before updating the spinners.
*/
private void updateSpinners(int year, int month, int dayOfMonth) {
mCurrentDate.set(Calendar.YEAR, year);
// compute the deltas before modifying the current date
int deltaMonths = getDelataMonth(month);
mCurrentDate.add(Calendar.MONTH, deltaMonths);
int deltaDays = getDelataDayOfMonth(dayOfMonth);
mCurrentDate.set(Calendar.YEAR, year);
mCurrentDate.add(Calendar.MONTH, deltaMonths);
mCurrentDate.add(Calendar.DAY_OF_MONTH, deltaDays);
if (mCurrentDate.before(mMinDate)) {