Package com.excilys.ebi.bank.model

Examples of com.excilys.ebi.bank.model.Calendar


  }

  @Override
  public Calendar getCalendar(Integer year, Integer month) {

    Calendar calendar = new Calendar();

    // build months
    List<DateTime> months = calendar.getMonths();

    DateMidnight thisMonth = getDefaultDateTime().toDateMidnight().withDayOfMonth(1);
    months.add(thisMonth.toDateTime());

    // display last 6 months
    while (months.size() < 6) {
      thisMonth = thisMonth.minusMonths(1);
      months.add(thisMonth.toDateTime());
    }

    reverse(months);

    // build selectedMonth
    if (year != null) {
      notNull(month, "month is required if year is specified");
      DateTime selectedMonth = new DateMidnight().withDayOfMonth(1).withYear(year).withMonthOfYear(month).toDateTime();
      calendar.setSelectedMonth(selectedMonth);
    }

    return calendar;
  }
View Full Code Here

TOP

Related Classes of com.excilys.ebi.bank.model.Calendar

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.