Examples of minusMonths()


Examples of org.joda.time.DateMidnight.minusMonths()

    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);
View Full Code Here

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

    // NB: cannot handle replaying of old logs or going back to the future
    if (date != null) {
      DateTime fixed = date.withYear(year);

      // flume clock is ahead or there is some latency, and the year rolled
      if (fixed.isAfter(now) && fixed.minusMonths(1).isAfter(now)) {
        fixed = date.withYear(year - 1);
      // flume clock is behind and the year rolled
      } else if (fixed.isBefore(now) && fixed.plusMonths(1).isBefore(now)) {
        fixed = date.withYear(year + 1);
      }
View Full Code Here

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

      case THISWEEK:
        return dt.minusWeeks(1).getMillis();
      case LASTWEEK:
        return dt.minusWeeks(2).getMillis();
      case THISMONTH:
        return dt.minusMonths(1).getMillis();
      case LASTMONTH:
        return dt.minusMonths(2).getMillis();
      case THISYEAR:
        return dt.minusYears(1).getMillis();
      case LASTYEAR:
View Full Code Here

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

      case LASTWEEK:
        return dt.minusWeeks(2).getMillis();
      case THISMONTH:
        return dt.minusMonths(1).getMillis();
      case LASTMONTH:
        return dt.minusMonths(2).getMillis();
      case THISYEAR:
        return dt.minusYears(1).getMillis();
      case LASTYEAR:
        return dt.minusYears(2).getMillis();
View Full Code Here

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

      case LASTWEEK:
        return dt.minusWeeks(1).getMillis();
      case THISMONTH:
        return dt.getMillis();
      case LASTMONTH:
        return dt.minusMonths(1).getMillis();
      case THISYEAR:
        return dt.getMillis();
      case LASTYEAR:
        return dt.minusYears(1).getMillis();
View Full Code Here

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

      DateTime now = new DateTime();
      int year = now.getYear();
      DateTime corrected = date.withYear(year);

      // flume clock is ahead or there is some latency, and the year rolled
      if (corrected.isAfter(now) && corrected.minusMonths(1).isAfter(now)) {
        corrected = date.withYear(year - 1);
      // flume clock is behind and the year rolled
      } else if (corrected.isBefore(now) && corrected.plusMonths(1).isBefore(now)) {
        corrected = date.withYear(year + 1);
      }
View Full Code Here

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

                           1,
                           0,
                           0,
                           0);
     
      firstDateOfMonth = firstDateOfMonth.minusMonths(PeriodSelector.this.numberOfPeriods);
     
      return firstDateOfMonth;
    }
    public DateTime getUpperBound(){
      DateTime lastDateOfMonth = new DateTime(this.year,
View Full Code Here

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

    // NB: cannot handle replaying of old logs or going back to the future
    if (date != null) {
      DateTime fixed = date.withYear(year);

      // flume clock is ahead or there is some latency, and the year rolled
      if (fixed.isAfter(now) && fixed.minusMonths(1).isAfter(now)) {
        fixed = date.withYear(year - 1);
      // flume clock is behind and the year rolled
      } else if (fixed.isBefore(now) && fixed.plusMonths(1).isBefore(now)) {
        fixed = date.withYear(year + 1);
      }
View Full Code Here

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

    // NB: cannot handle replaying of old logs or going back to the future
    if (date != null) {
      DateTime fixed = date.withYear(year);

      // flume clock is ahead or there is some latency, and the year rolled
      if (fixed.isAfter(now) && fixed.minusMonths(1).isAfter(now)) {
        fixed = date.withYear(year - 1);
      // flume clock is behind and the year rolled
      } else if (fixed.isBefore(now) && fixed.plusMonths(1).isBefore(now)) {
        fixed = date.withYear(year + 1);
      }
View Full Code Here

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

            now
        )
    );
    Assert.assertFalse(
        rule.appliesTo(
            builder.interval(new Interval(now.minusMonths(2), now.minusDays(1)))
                       .build(),
            now
        )
    );
  }
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.