java.time.LocalDate#plusMonths ( )源码实例Demo

下面列出了java.time.LocalDate#plusMonths ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: finmath-lib   文件: ScheduleGenerator.java
/**
 * Create a new date by "adding" a year fraction to the start date.
 * The year fraction is interpreted in a 30/360 way. More specifically,
 * every integer unit advances by a year, each remaining fraction of 12
 * advances by a month and each remaining fraction of 30 advances a day.
 *
 * The function may be used to ease the creation of maturities in spreadsheets.
 *
 * @param baseDate The start date.
 * @param offsetYearFrac The year fraction in 30/360 to be used for adding to the start date.
 * @return A date corresponding the maturity.
 */
private static LocalDate createDateFromDateAndOffset(final LocalDate baseDate, double offsetYearFrac) {

	// Years
	LocalDate maturity = baseDate.plusYears((int)offsetYearFrac);

	// Months
	offsetYearFrac = (offsetYearFrac - (int)offsetYearFrac) * 12;
	maturity = maturity.plusMonths((int)offsetYearFrac);

	// Days
	offsetYearFrac = (offsetYearFrac - (int)offsetYearFrac) * 30;
	maturity = maturity.plusDays((int)Math.round(offsetYearFrac));

	return maturity;
}
 
源代码2 项目: finmath-lib   文件: DataTableBasic.java
private LocalDate dateFromOffset(final LocalDate startDate, final int offset) {
	LocalDate date = null;
	switch(convention) {
	case YEARS:
		date = startDate.plusYears(offset);
		break;
	case MONTHS:
		date = startDate.plusMonths(offset);
		break;
	case DAYS:
		date = startDate.plusDays(offset);
		break;
	case WEEKS:
		date = startDate.plusWeeks(offset);
		break;
	default:
		throw new IllegalArgumentException("Unknown convention " + convention + ".");
	}
	return date;
}
 
源代码3 项目: finmath-lib   文件: ScheduleGenerator.java
/**
 * Create a new date by "adding" a year fraction to the start date.
 * The year fraction is interpreted in a 30/360 way. More specifically,
 * every integer unit advances by a year, each remaining fraction of 12
 * advances by a month and each remaining fraction of 30 advances a day.
 *
 * The function may be used to ease the creation of maturities in spreadsheets.
 *
 * @param baseDate The start date.
 * @param offsetYearFrac The year fraction in 30/360 to be used for adding to the start date.
 * @return A date corresponding the maturity.
 */
private static LocalDate createDateFromDateAndOffset(final LocalDate baseDate, double offsetYearFrac) {

	// Years
	LocalDate maturity = baseDate.plusYears((int)offsetYearFrac);

	// Months
	offsetYearFrac = (offsetYearFrac - (int)offsetYearFrac) * 12;
	maturity = maturity.plusMonths((int)offsetYearFrac);

	// Days
	offsetYearFrac = (offsetYearFrac - (int)offsetYearFrac) * 30;
	maturity = maturity.plusDays((int)Math.round(offsetYearFrac));

	return maturity;
}
 
源代码4 项目: finmath-lib   文件: SABRShiftedSmileCalibration.java
/**
 * Construct the volatility (half-) smile of cash settled payer swaptions.
 */
private void findPayerVolatilities() {

	//convert to volatilities
	cashPayerVolatilities = new TreeMap<>();
	for(final int moneyness : cashPayerPremiums.getGridNodesPerMoneyness().keySet()) {

		final ArrayList<Integer> maturities = new ArrayList<>();
		final ArrayList<Integer> terminations = new ArrayList<>();
		final ArrayList<Double> values = new ArrayList<>();

		for(final int maturity : interpolationNodes.getMaturities()) {
			for(final int termination : interpolationNodes.getTerminationsForMaturity(maturity)) {
				if(cashPayerPremiums.containsEntryFor(maturity, termination, moneyness)){

					final LocalDate maturityDate = referenceDate.plusMonths(maturity);
					final LocalDate terminationDate = maturityDate.plusMonths(termination);

					final Schedule fixSchedule = fixMetaSchedule.generateSchedule(referenceDate, maturityDate, terminationDate);
					final double swapRate = swapRateTable.getValue(maturity, termination);
					final double cashAnnuity = cashFunction(swapRate, fixSchedule);

					maturities.add(maturity);
					terminations.add(termination);
					values.add(AnalyticFormulas.bachelierOptionImpliedVolatility(swapRate, fixSchedule.getFixing(0), swapRate + moneyness /10000.0,
							cashAnnuity, cashPayerPremiums.getValue(maturity, termination, moneyness)));
				}
			}
		}
		final DataTableLight volatilityTable = new DataTableLight("VolatilitiesPayer"+moneyness, TableConvention.MONTHS, maturities, terminations, values);
		cashPayerVolatilities.put(moneyness, volatilityTable);
	}

}
 
源代码5 项目: axelor-open-suite   文件: YearServiceImpl.java
public List<Period> generatePeriods(Year year) throws AxelorException {

    List<Period> periods = new ArrayList<Period>();
    Integer duration = year.getPeriodDurationSelect();
    LocalDate fromDate = year.getFromDate();
    LocalDate toDate = year.getToDate();
    LocalDate periodToDate = fromDate;
    Integer periodNumber = 1;
    int c = 0;
    int loopLimit = 1000;
    while (periodToDate.isBefore(toDate)) {
      if (periodNumber != 1) fromDate = fromDate.plusMonths(duration);
      if (c >= loopLimit) {
        throw new AxelorException(
            TraceBackRepository.CATEGORY_INCONSISTENCY, I18n.get(IExceptionMessage.PERIOD_3));
      }
      c += 1;
      periodToDate = fromDate.plusMonths(duration).minusDays(1);
      if (periodToDate.isAfter(toDate)) periodToDate = toDate;
      if (fromDate.isAfter(toDate)) continue;
      Period period = new Period();
      period.setFromDate(fromDate);
      period.setToDate(periodToDate);
      period.setYear(year);
      period.setName(String.format("%02d", periodNumber) + "/" + year.getCode());
      period.setCode(
          (String.format("%02d", periodNumber)
                  + "/"
                  + year.getCode()
                  + "_"
                  + year.getCompany().getCode())
              .toUpperCase());
      period.setStatusSelect(year.getStatusSelect());
      periods.add(period);
      periodNumber++;
    }
    return periods;
  }
 
@Test
public void a_cubeATM() {

	final ArrayList<Integer> maturities			= new ArrayList<>();
	final ArrayList<Integer> terminations			= new ArrayList<>();
	final ArrayList<Double> volatilitiesModel		= new ArrayList<>();
	final ArrayList<Double> volatilitiesMarket	= new ArrayList<>();

	for(final int maturity : physicalVolatilities.getMaturities(0)) {
		for(final int termination : physicalVolatilities.getTenors(0, maturity)) {

			final LocalDate maturityDate = referenceDate.plusMonths(maturity);
			final LocalDate terminationDate = maturityDate.plusMonths(termination);

			final Schedule floatSchedule = floatMetaSchedule.generateSchedule(referenceDate, maturityDate, terminationDate);
			final Schedule fixSchedule = fixMetaSchedule.generateSchedule(referenceDate, maturityDate, terminationDate);
			final double swapRate = Swap.getForwardSwapRate(fixSchedule, floatSchedule, model.getForwardCurve(forwardCurveName), model);

			try {
				final double volatility = cube.getValue(model, fixSchedule.getPayment(fixSchedule.getNumberOfPeriods()-1), fixSchedule.getFixing(0), swapRate,
						QuotingConvention.VOLATILITYNORMAL);
				maturities.add(maturity);
				terminations.add(termination);
				volatilitiesModel.add(volatility);
				volatilitiesMarket.add(physicalVolatilities.getValue(maturity, termination, 0));
			} catch (final Exception e) {
				maturities.add(maturity);
				terminations.add(termination);
				volatilitiesModel.add(0.0);
				volatilitiesMarket.add(physicalVolatilities.getValue(maturity, termination, 0));
			}
		}
	}

	final DataTableLight modelTable	= new DataTableLight("Volatilites-Model", TableConvention.MONTHS, maturities, terminations, volatilitiesModel);
	final DataTableLight marketTable	= new DataTableLight("Volatilites-Market", TableConvention.MONTHS, maturities, terminations, volatilitiesMarket);
	output.append(marketTable.toString()+"\n");
	output.append("\n"+modelTable.toString()+"\n\n\n\n");

}
 
源代码7 项目: dragonwell8_jdk   文件: TCKLocalDate.java
@Test(expectedExceptions=DateTimeException.class)
public void test_plusMonths_long_invalidTooLargeMaxAddMax() {
    LocalDate test = LocalDate.of(Year.MAX_VALUE, 12, 1);
    test.plusMonths(Long.MAX_VALUE);
}
 
源代码8 项目: TencentKona-8   文件: TCKLocalDate.java
@Test(expectedExceptions=DateTimeException.class)
public void test_plusMonths_long_invalidTooLargeMaxAddMax() {
    LocalDate test = LocalDate.of(Year.MAX_VALUE, 12, 1);
    test.plusMonths(Long.MAX_VALUE);
}
 
源代码9 项目: axelor-open-suite   文件: ForecastRecapService.java
public void populateWithSalaries(ForecastRecap forecastRecap) throws AxelorException {
  List<Employee> employeeList = new ArrayList<Employee>();
  ForecastRecapLineType salaryForecastRecapLineType =
      this.getForecastRecapLineType(ForecastRecapLineTypeRepository.ELEMENT_SALARY);
  if (forecastRecap.getBankDetails() != null) {
    employeeList =
        Beans.get(EmployeeRepository.class)
            .all()
            .filter(
                "self.mainEmploymentContract.payCompany = ?1 AND self.bankDetails = ?2",
                forecastRecap.getCompany(),
                forecastRecap.getBankDetails())
            .fetch();
  } else {
    employeeList =
        Beans.get(EmployeeRepository.class)
            .all()
            .filter("self.mainEmploymentContract.payCompany = ?1", forecastRecap.getCompany())
            .fetch();
  }
  LocalDate itDate =
      LocalDate.parse(forecastRecap.getFromDate().toString(), DateTimeFormatter.ISO_DATE);
  while (!itDate.isAfter(forecastRecap.getToDate())) {
    LocalDate monthEnd = itDate.withDayOfMonth(itDate.lengthOfMonth());
    if (itDate.isEqual(monthEnd)) {
      for (Employee employee : employeeList) {
        forecastRecap.addForecastRecapLineListItem(
            this.createForecastRecapLine(
                itDate,
                salaryForecastRecapLineType.getTypeSelect(),
                employee
                    .getHourlyRate()
                    .multiply(employee.getWeeklyWorkHours().multiply(new BigDecimal(4))),
                null,
                null,
                null,
                salaryForecastRecapLineType));
      }
      itDate = itDate.plusMonths(1);
    } else {
      itDate = monthEnd;
    }
  }
}
 
源代码10 项目: finmath-lib   文件: SABRVolatilityCubeTest.java
@Test
public void a_cubeATM() {

	System.out.println("Testing cube at atm level...");

	final ArrayList<Integer> maturities			= new ArrayList<>();
	final ArrayList<Integer> terminations			= new ArrayList<>();
	final ArrayList<Double> volatilitiesModel		= new ArrayList<>();
	final ArrayList<Double> volatilitiesMarket	= new ArrayList<>();

	for(final int maturity : physicalVolatilities.getMaturities(0)) {
		for(final int termination : physicalVolatilities.getTenors(0, maturity)) {

			final LocalDate maturityDate = referenceDate.plusMonths(maturity);
			final LocalDate terminationDate = maturityDate.plusMonths(termination);

			final Schedule floatSchedule = floatMetaSchedule.generateSchedule(referenceDate, maturityDate, terminationDate);
			final Schedule fixSchedule = fixMetaSchedule.generateSchedule(referenceDate, maturityDate, terminationDate);
			final double swapRate = Swap.getForwardSwapRate(fixSchedule, floatSchedule, model.getForwardCurve(forwardCurveName), model);

			try {
				final double volatility = cube.getValue(model, fixSchedule.getPayment(fixSchedule.getNumberOfPeriods()-1), fixSchedule.getFixing(0), swapRate,
						QuotingConvention.VOLATILITYNORMAL);
				maturities.add(maturity);
				terminations.add(termination);
				volatilitiesModel.add(volatility);
				volatilitiesMarket.add(physicalVolatilities.getValue(maturity, termination, 0));
			} catch (final Exception e) {
				maturities.add(maturity);
				terminations.add(termination);
				volatilitiesModel.add(0.0);
				volatilitiesMarket.add(physicalVolatilities.getValue(maturity, termination, 0));
			}
		}
	}

	final DataTableLight modelTable	= new DataTableLight("Volatilites-Model", TableConvention.MONTHS, maturities, terminations, volatilitiesModel);
	final DataTableLight marketTable	= new DataTableLight("Volatilites-Market", TableConvention.MONTHS, maturities, terminations, volatilitiesMarket);
	output.append(marketTable.toString()+"\n");
	output.append("\n"+modelTable.toString()+"\n\n\n\n");

}
 
源代码11 项目: flowable-engine   文件: ExecutionQueryTest.java
@Test
@Deployment(resources = { "org/flowable/engine/test/api/oneTaskProcess.bpmn20.xml" })
public void testQueryLocalDateVariable() throws Exception {
    Map<String, Object> vars = new HashMap<>();
    LocalDate localDate = LocalDate.now();
    vars.put("localDateVar", localDate);

    ProcessInstance processInstance1 = runtimeService.startProcessInstanceByKey("oneTaskProcess", vars);

    LocalDate localDate2 = localDate.plusDays(1);
    vars = new HashMap<>();
    vars.put("localDateVar", localDate);
    vars.put("localDateVar2", localDate2);
    ProcessInstance processInstance2 = runtimeService.startProcessInstanceByKey("oneTaskProcess", vars);

    LocalDate nextYear = localDate.plusYears(1);
    vars = new HashMap<>();
    vars.put("localDateVar", nextYear);
    ProcessInstance processInstance3 = runtimeService.startProcessInstanceByKey("oneTaskProcess", vars);

    LocalDate nextMonth = localDate.plusMonths(1);

    LocalDate twoYearsLater = localDate.plusYears(2);

    LocalDate oneYearAgo = localDate.minusYears(1);

    // Query on single localDate variable, should result in 2 matches
    ExecutionQuery query = runtimeService.createExecutionQuery().variableValueEquals("localDateVar", localDate);
    List<Execution> executions = query.list();
    assertThat(executions).hasSize(2);

    // Query on two localDate variables, should result in single value
    query = runtimeService.createExecutionQuery().variableValueEquals("localDateVar", localDate).variableValueEquals("localDateVar2", localDate2);
    Execution execution = query.singleResult();
    assertThat(execution).isNotNull();
    assertThat(execution.getId()).isEqualTo(processInstance2.getId());

    // Query with unexisting variable value
    execution = runtimeService.createExecutionQuery().variableValueEquals("localDateVar", localDate.minusDays(1)).singleResult();
    assertThat(execution).isNull();

    // Test NOT_EQUALS
    execution = runtimeService.createExecutionQuery().variableValueNotEquals("localDateVar", localDate).singleResult();
    assertThat(execution).isNotNull();
    assertThat(execution.getId()).isEqualTo(processInstance3.getId());

    // Test GREATER_THAN
    execution = runtimeService.createExecutionQuery().variableValueGreaterThan("localDateVar", nextMonth).singleResult();
    assertThat(execution).isNotNull();
    assertThat(execution.getId()).isEqualTo(processInstance3.getId());

    assertThat(runtimeService.createExecutionQuery().variableValueGreaterThan("localDateVar", nextYear).count()).isZero();
    assertThat(runtimeService.createExecutionQuery().variableValueGreaterThan("localDateVar", oneYearAgo).count()).isEqualTo(3);

    // Test GREATER_THAN_OR_EQUAL
    execution = runtimeService.createExecutionQuery().variableValueGreaterThanOrEqual("localDateVar", nextMonth).singleResult();
    assertThat(execution).isNotNull();
    assertThat(execution.getId()).isEqualTo(processInstance3.getId());

    execution = runtimeService.createExecutionQuery().variableValueGreaterThanOrEqual("localDateVar", nextYear).singleResult();
    assertThat(execution).isNotNull();
    assertThat(execution.getId()).isEqualTo(processInstance3.getId());

    assertThat(runtimeService.createExecutionQuery().variableValueGreaterThanOrEqual("localDateVar", oneYearAgo).count()).isEqualTo(3);

    // Test LESS_THAN
    executions = runtimeService.createExecutionQuery().variableValueLessThan("localDateVar", nextYear).list();
    assertThat(executions)
        .extracting(Execution::getId)
        .containsExactlyInAnyOrder(
            processInstance1.getId(),
            processInstance2.getId()
        );

    assertThat(runtimeService.createExecutionQuery().variableValueLessThan("localDateVar", localDate).count()).isZero();
    assertThat(runtimeService.createExecutionQuery().variableValueLessThan("localDateVar", twoYearsLater).count()).isEqualTo(3);

    // Test LESS_THAN_OR_EQUAL
    executions = runtimeService.createExecutionQuery().variableValueLessThanOrEqual("localDateVar", nextYear).list();
    assertThat(executions).hasSize(3);

    assertThat(runtimeService.createExecutionQuery().variableValueLessThanOrEqual("localDateVar", oneYearAgo).count()).isZero();

    // Test value-only matching
    execution = runtimeService.createExecutionQuery().variableValueEquals(nextYear).singleResult();
    assertThat(execution).isNotNull();
    assertThat(execution.getId()).isEqualTo(processInstance3.getId());

    executions = runtimeService.createExecutionQuery().variableValueEquals(localDate).list();
    assertThat(executions)
        .extracting(Execution::getId)
        .containsExactlyInAnyOrder(
            processInstance1.getId(),
            processInstance2.getId()
        );

    execution = runtimeService.createExecutionQuery().variableValueEquals(twoYearsLater).singleResult();
    assertThat(execution).isNull();
}
 
源代码12 项目: finmath-lib   文件: SABRVolatilityCubeTest.java
@Test
public void a_cubeATM() {

	System.out.println("Testing cube at atm level...");

	final ArrayList<Integer> maturities			= new ArrayList<>();
	final ArrayList<Integer> terminations			= new ArrayList<>();
	final ArrayList<Double> volatilitiesModel		= new ArrayList<>();
	final ArrayList<Double> volatilitiesMarket	= new ArrayList<>();

	for(final int maturity : physicalVolatilities.getMaturities(0)) {
		for(final int termination : physicalVolatilities.getTenors(0, maturity)) {

			final LocalDate maturityDate = referenceDate.plusMonths(maturity);
			final LocalDate terminationDate = maturityDate.plusMonths(termination);

			final Schedule floatSchedule = floatMetaSchedule.generateSchedule(referenceDate, maturityDate, terminationDate);
			final Schedule fixSchedule = fixMetaSchedule.generateSchedule(referenceDate, maturityDate, terminationDate);
			final double swapRate = Swap.getForwardSwapRate(fixSchedule, floatSchedule, model.getForwardCurve(forwardCurveName), model);

			try {
				final double volatility = cube.getValue(model, fixSchedule.getPayment(fixSchedule.getNumberOfPeriods()-1), fixSchedule.getFixing(0), swapRate,
						QuotingConvention.VOLATILITYNORMAL);
				maturities.add(maturity);
				terminations.add(termination);
				volatilitiesModel.add(volatility);
				volatilitiesMarket.add(physicalVolatilities.getValue(maturity, termination, 0));
			} catch (final Exception e) {
				maturities.add(maturity);
				terminations.add(termination);
				volatilitiesModel.add(0.0);
				volatilitiesMarket.add(physicalVolatilities.getValue(maturity, termination, 0));
			}
		}
	}

	final DataTableLight modelTable	= new DataTableLight("Volatilites-Model", TableConvention.MONTHS, maturities, terminations, volatilitiesModel);
	final DataTableLight marketTable	= new DataTableLight("Volatilites-Market", TableConvention.MONTHS, maturities, terminations, volatilitiesMarket);
	output.append(marketTable.toString()+"\n");
	output.append("\n"+modelTable.toString()+"\n\n\n\n");

}
 
源代码13 项目: openjdk-jdk8u   文件: TCKLocalDate.java
@Test(expectedExceptions=DateTimeException.class)
public void test_plusMonths_long_invalidTooLargeMaxAddMin() {
    LocalDate test = LocalDate.of(Year.MAX_VALUE, 12, 1);
    test.plusMonths(Long.MIN_VALUE);
}
 
源代码14 项目: jdk8u_jdk   文件: TCKLocalDate.java
@Test(expectedExceptions=DateTimeException.class)
public void test_plusMonths_long_invalidTooLargeMaxAddMin() {
    LocalDate test = LocalDate.of(Year.MAX_VALUE, 12, 1);
    test.plusMonths(Long.MIN_VALUE);
}
 
源代码15 项目: openjdk-jdk8u-backup   文件: TCKLocalDate.java
@Test(expectedExceptions=DateTimeException.class)
public void test_plusMonths_long_invalidTooLargeMaxAddMax() {
    LocalDate test = LocalDate.of(Year.MAX_VALUE, 12, 1);
    test.plusMonths(Long.MAX_VALUE);
}
 
源代码16 项目: openjdk-8-source   文件: TCKLocalDate.java
@Test(expectedExceptions=DateTimeException.class)
public void test_plusMonths_long_invalidTooLargeMaxAddMin() {
    LocalDate test = LocalDate.of(Year.MAX_VALUE, 12, 1);
    test.plusMonths(Long.MIN_VALUE);
}
 
源代码17 项目: openjdk-jdk9   文件: TCKLocalDate.java
@Test(expectedExceptions=DateTimeException.class)
public void test_plusMonths_long_invalidTooLargeMaxAddMin() {
    LocalDate test = LocalDate.of(Year.MAX_VALUE, 12, 1);
    test.plusMonths(Long.MIN_VALUE);
}
 
源代码18 项目: jdk8u-jdk   文件: TCKLocalDate.java
@Test(expectedExceptions=DateTimeException.class)
public void test_plusMonths_long_invalidTooLargeMaxAddMin() {
    LocalDate test = LocalDate.of(Year.MAX_VALUE, 12, 1);
    test.plusMonths(Long.MIN_VALUE);
}
 
源代码19 项目: openjdk-8   文件: TCKLocalDate.java
@Test(expectedExceptions=DateTimeException.class)
public void test_plusMonths_long_invalidTooLargeMaxAddMin() {
    LocalDate test = LocalDate.of(Year.MAX_VALUE, 12, 1);
    test.plusMonths(Long.MIN_VALUE);
}
 
源代码20 项目: tablesaw   文件: DateFiltersTest.java
@Test
public void testGetMonthValue() {
  LocalDate date = LocalDate.of(2015, 1, 25);
  Month[] months = Month.values();

  DateColumn dateColumn = DateColumn.create("test");
  for (int i = 0; i < months.length; i++) {
    dateColumn.append(date);
    date = date.plusMonths(1);
  }

  StringColumn month = dateColumn.month();
  IntColumn monthValue = dateColumn.monthValue();

  for (int i = 0; i < months.length; i++) {
    assertEquals(months[i].name(), month.get(i).toUpperCase());
    assertEquals(i + 1, monthValue.get(i), 0.001);
  }

  assertTrue(dateColumn.isInJanuary().contains(0));
  assertTrue(dateColumn.isInFebruary().contains(1));
  assertTrue(dateColumn.isInMarch().contains(2));
  assertTrue(dateColumn.isInApril().contains(3));
  assertTrue(dateColumn.isInMay().contains(4));
  assertTrue(dateColumn.isInJune().contains(5));
  assertTrue(dateColumn.isInJuly().contains(6));
  assertTrue(dateColumn.isInAugust().contains(7));
  assertTrue(dateColumn.isInSeptember().contains(8));
  assertTrue(dateColumn.isInOctober().contains(9));
  assertTrue(dateColumn.isInNovember().contains(10));
  assertTrue(dateColumn.isInDecember().contains(11));

  assertTrue(dateColumn.isInQ1().contains(2));
  assertTrue(dateColumn.isInQ2().contains(4));
  assertTrue(dateColumn.isInQ3().contains(8));
  assertTrue(dateColumn.isInQ4().contains(11));

  Table t = Table.create("Test");
  t.addColumns(dateColumn);
  IntColumn index = IntColumn.indexColumn("index", t.rowCount(), 0);
  t.addColumns(index);

  assertTrue(t.where(t.dateColumn("test").isInJanuary()).intColumn("index").contains(0));
  assertTrue(t.where(t.dateColumn("test").isInFebruary()).intColumn("index").contains(1));
  assertTrue(t.where(t.dateColumn("test").isInMarch()).intColumn("index").contains(2));
  assertTrue(t.where(t.dateColumn("test").isInApril()).intColumn("index").contains(3));
  assertTrue(t.where(t.dateColumn("test").isInMay()).intColumn("index").contains(4));
  assertTrue(t.where(t.dateColumn("test").isInJune()).intColumn("index").contains(5));
  assertTrue(t.where(t.dateColumn("test").isInJuly()).intColumn("index").contains(6));
  assertTrue(t.where(t.dateColumn("test").isInAugust()).intColumn("index").contains(7));
  assertTrue(t.where(t.dateColumn("test").isInSeptember()).intColumn("index").contains(8));
  assertTrue(t.where(t.dateColumn("test").isInOctober()).intColumn("index").contains(9));
  assertTrue(t.where(t.dateColumn("test").isInNovember()).intColumn("index").contains(10));
  assertTrue(t.where(t.dateColumn("test").isInDecember()).intColumn("index").contains(11));

  assertTrue(t.where(t.dateColumn("test").isInQ1()).intColumn("index").contains(2));
  assertTrue(t.where(t.dateColumn("test").isInQ2()).intColumn("index").contains(4));
  assertTrue(t.where(t.dateColumn("test").isInQ3()).intColumn("index").contains(8));
  assertTrue(t.where(t.dateColumn("test").isInQ4()).intColumn("index").contains(11));
}