예제 #1
0
  public void leftSilde() {

    if (style == MONTH_STYLE) {
      if (mShowDate.month == 1) {
        mShowDate.month = 12;
        mShowDate.year -= 1;
      } else {
        mShowDate.month -= 1;
      }

    } else if (style == WEEK_STYLE) {
      int lastMonthDays = JGDateUtil.getMonthDays(mShowDate.year, mShowDate.month);
      if (mShowDate.day - WEEK < 1) {
        if (mShowDate.month == 1) {
          mShowDate.month = 12;
          mShowDate.year -= 1;
        } else {
          mShowDate.month -= 1;
        }
        mShowDate.day = lastMonthDays - WEEK + mShowDate.day;

      } else {
        mShowDate.day -= WEEK;
      }
      Log.i(TAG, "leftSilde" + mShowDate.toString());
    }
    update();
  }
예제 #2
0
  public void rightSilde() {
    if (style == MONTH_STYLE) {

      if (mShowDate.month == 12) {
        mShowDate.month = 1;
        mShowDate.year += 1;
      } else {
        mShowDate.month += 1;
      }

    } else if (style == WEEK_STYLE) {
      int currentMonthDays = JGDateUtil.getMonthDays(mShowDate.year, mShowDate.month);
      if (mShowDate.day + WEEK > currentMonthDays) {
        if (mShowDate.month == 12) {
          mShowDate.month = 1;
          mShowDate.year += 1;
        } else {
          mShowDate.month += 1;
        }
        mShowDate.day = WEEK - currentMonthDays + mShowDate.day;
      } else {
        mShowDate.day += WEEK;
      }
    }
    update();
  }