Examples of minusDays()


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

    @Override
    public Date getCurrentExpiringDate() {
        CalendarData calendarData = getCurrentVersion();
        if (calendarData != null) {
            LocalDate startDate = calendarData.getExpiringDate();
            return startDate != null ? startDate.minusDays(1)
                    .toDateTimeAtStartOfDay()
                    .toDate() : null;
        }
        return null;
    }
View Full Code Here

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

    public void testRemoveOldPersistentTokens() {
        User admin = userRepository.findOne("admin");
        int existingCount = persistentTokenRepository.findByUser(admin).size();
        generateUserToken(admin, "1111-1111", new LocalDate());
        LocalDate now = new LocalDate();
        generateUserToken(admin, "2222-2222", now.minusDays(32));
        assertThat(persistentTokenRepository.findByUser(admin)).hasSize(existingCount + 2);
        userService.removeOldPersistentTokens();
        assertThat(persistentTokenRepository.findByUser(admin)).hasSize(existingCount + 1);
    }
View Full Code Here

Examples of org.joda.time.LocalDateTime.minusDays()

    mongoTemplate.dropCollection(User.class);

    LocalDateTime now = new LocalDateTime();

    User user1 = new User("u1", new PushMessage("1", "aaa", now.toDate()));
    User user2 = new User("u2", new PushMessage("2", "bbb", now.minusDays(2).toDate()));
    User user3 = new User("u3", new PushMessage("3", "ccc", now.minusDays(1).toDate()));

    mongoTemplate.save(user1);
    mongoTemplate.save(user2);
    mongoTemplate.save(user3);
View Full Code Here

Examples of org.joda.time.YearMonthDay.minusDays()

                    nextUrl =
                            getRequest().getContextPath() + getWeeklyViewUrl() + "&" + getFirstDayParameter() + "="
                                    + firstDay.plusDays(Lesson.NUMBER_OF_DAYS_IN_WEEK).toString("ddMMyyyy");
                    beforeUrl =
                            getRequest().getContextPath() + getWeeklyViewUrl() + "&" + getFirstDayParameter() + "="
                                    + firstDay.minusDays(Lesson.NUMBER_OF_DAYS_IN_WEEK).toString("ddMMyyyy");
                    builder.append(
                            "<tr><td class=\"tcalendarlinks\"></td><td colspan=\"7\" class=\"acenter tcalendarlinks\"> <span class=\"smalltxt\"><a href=\"")
                            .append(beforeUrl).append("\">").append("&lt;&lt; ").append(getMessage("label.previous.week"))
                            .append("</a>");
                    builder.append(" , ").append("<a href=\"").append(nextUrl).append("\">")
View Full Code Here

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

      }
      date = date.plusDays(1);
    }
    LocalDate result = lastFridayOfMonth.with(PREVIOUS_FRIDAY_ADJUSTER);
    while (!holidayCalendar.isWorkingDay(result)) {
      result = result.minusDays(1);
    }
    return result;
  }

  @Override
View Full Code Here

Examples of org.threeten.bp.ZonedDateTime.minusDays()

    final ZonedDateTime previousAccrualDate = getCoupons().getNthPayment(couponIndex).getAccrualStartDate();
    final ZonedDateTime nextAccrualDate = getCoupons().getNthPayment(couponIndex).getAccrualEndDate();
    final CouponInflationWithMargin currentCoupon = ((CouponInflationWithMargin) getCoupons().getNthPayment(couponIndex));
    final double accruedInterest = AccruedInterestCalculator.getAccruedInterest(getDayCount(), couponIndex, nbCoupon, previousAccrualDate, date, nextAccrualDate, currentCoupon.getFactor(),
        getCouponPerYear(), isEOM()) * getCoupons().getNthPayment(couponIndex).getNotional();
    if (getExCouponDays() != 0 && nextAccrualDate.minusDays(getExCouponDays()).isBefore(date)) {
      result = accruedInterest - currentCoupon.getFactor() / _couponPerYear;
    } else {
      result = accruedInterest;
    }
    return result;
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.