Examples of minusYears()


Examples of org.joda.time.DateTime.minusYears()

  private final LastRunPeriodFormatter formatter = new LastRunPeriodFormatter();

  @Test
  public void testFormatterNormal() {
    DateTime startDate = new DateTime();
    startDate = startDate.minusYears(1).minusMonths(12).minusHours(124).minusMinutes(25).minusSeconds(1);
    TaskRun mostRecentTaskRun = new TaskRun(startDate.toDate(), startDate.plusHours(8).toDate(), "", "", "", 1);
    String printLastRun = formatter.printLastRun(mostRecentTaskRun);
    assertEquals("2 years, 5 days, 4 hours and 25 minutes ago", printLastRun);
  }
View Full Code Here

Examples of org.joda.time.DateTime.minusYears()

  }

  @Test
  public void testFormatterPluralForm() {
    DateTime startDate = new DateTime();
    startDate = startDate.minusYears(2).minusMonths(2).minusDays(2).minusHours(2).minusMinutes(2);
    TaskRun mostRecentTaskRun = new TaskRun(startDate.toDate(), startDate.plusHours(8).toDate(), "", "", "", 1);
    String printLastRun = formatter.printLastRun(mostRecentTaskRun);
    assertEquals("2 years, 2 months, 2 days, 2 hours and 2 minutes ago", printLastRun);
  }
View Full Code Here

Examples of org.joda.time.DateTime.minusYears()

  }

  @Test
  public void testFormatterSingularForm() {
    DateTime startDate = new DateTime();
    startDate = startDate.minusYears(1).minusMonths(1).minusDays(1).minusHours(1).minusMinutes(1);
    TaskRun mostRecentTaskRun = new TaskRun(startDate.toDate(), startDate.plusHours(8).toDate(), "", "", "", 1);
    String printLastRun = formatter.printLastRun(mostRecentTaskRun);
    assertEquals("1 year, 1 month, 1 day, 1 hour and 1 minute ago", printLastRun);
  }
View Full Code Here

Examples of org.joda.time.DateTime.minusYears()

    cboYearModel.removeAllElements();
   
    while(dateIterator.getYear() >=  this.lowerBound.getYear()){
      this.cboYear.addItem(new Year(dateIterator.getYear()));

      dateIterator = dateIterator.minusYears(1);
    }
   
    this.cboYear.addActionListener(this);
   
    if(selectedYear != null && cboYearModel.getSize() > 0){
View Full Code Here

Examples of org.joda.time.LocalDate.minusYears()

        LocalDate periodStartDate = null;
        if (fromDate != null) {
            periodStartDate = fromDate;
        } else {
            final LocalDate currentDate = DateUtils.getLocalDateOfTenant();
            if (seedDate.isBefore(currentDate.minusYears(1))) {
                periodStartDate = currentDate.minusYears(1);
            } else {
                periodStartDate = recurrenceStartDate;
            }
        }
View Full Code Here

Examples of org.joda.time.LocalDate.minusYears()

        if (fromDate != null) {
            periodStartDate = fromDate;
        } else {
            final LocalDate currentDate = DateUtils.getLocalDateOfTenant();
            if (seedDate.isBefore(currentDate.minusYears(1))) {
                periodStartDate = currentDate.minusYears(1);
            } else {
                periodStartDate = recurrenceStartDate;
            }
        }
        return periodStartDate;
View Full Code Here

Examples of org.threeten.bp.LocalDate.minusYears()

    if (!TESTED_PREFIX_SET.contains(futurePrefix)) {
      LOG.debug("We recommended that you ask QR to test behaviour of IRFutureOption Volatility Surface's Expiries for prefix {}", futurePrefix);
      // The reason being that we have hard coded the behaviour of 6 consecutive months, then quarterly thereafter..
    }
    final LocalDate expiry  = FutureOptionUtils.getApproximateIRFutureOptionWithSerialOptionsExpiry(nthFuture, curveDate);
    return getMonthYearCode(expiry, expiry.minusYears(10));
  }

  /**
   * Produces the month-year string required to build ExternalId for Bloomberg ticker of Soybean Future Options,
   * which have a different set of expiry months
View Full Code Here

Examples of org.threeten.bp.LocalDate.minusYears()

    String dataField = request.getDataField();
    if (endDate == null) {
      endDate = DateUtils.previousWeekDay();
    }
    if (startDate == null) {
      startDate = endDate.minusYears(1);
    }
    checkValidDateRange(startDate, endDate);
   
    Set<ExternalId> missingIdentifiers = Sets.newHashSet();
    for (ExternalId identifier : externalIds) {
View Full Code Here

Examples of org.threeten.bp.Year.minusYears()

    }

    @Test
    public void test_minusYear_zero_equals() {
        Year base = Year.of(2007);
        assertEquals(base.minusYears(0), base);
    }

    @Test
    public void test_minusYears_big() {
        long years = 20L + Year.MAX_VALUE;
View Full Code Here

Examples of org.threeten.bp.YearMonth.minusYears()

    // minusYears()
    //-----------------------------------------------------------------------
    @Test
    public void test_minusYears_long() {
        YearMonth test = YearMonth.of(2008, 6);
        assertEquals(test.minusYears(1), YearMonth.of(2007, 6));
    }

    @Test
    public void test_minusYears_long_noChange_equal() {
        YearMonth test = YearMonth.of(2008, 6);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.