Exemplo n.º 1
0
  /**
   * Set the selected date of this DatePicker.
   *
   * @param day The day value of selected date.
   * @param month The month value of selected date.
   * @param year The year value of selected date.
   */
  public void setDate(int day, int month, int year) {
    if (mAdapter.getYear() == year && mAdapter.getMonth() == month && mAdapter.getDay() == day)
      return;

    mAdapter.setDate(day, month, year, false);
    goTo(month, year);
  }
Exemplo n.º 2
0
 /**
  * Get the formatted string of selected date.
  *
  * @param formatter The DateFormat used to format the date.
  * @return
  */
 public String getFormattedDate(DateFormat formatter) {
   mCalendar.set(Calendar.YEAR, mAdapter.getYear());
   mCalendar.set(Calendar.MONTH, mAdapter.getMonth());
   mCalendar.set(Calendar.DAY_OF_MONTH, mAdapter.getDay());
   return formatter.format(mCalendar.getTime());
 }
Exemplo n.º 3
0
 /** @return The month value of selected date. */
 public int getMonth() {
   return mAdapter.getMonth();
 }