Package org.joda.time

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


            Util.bind(datebox, new Util.Getter<Date>() {
                @Override
                public Date get() {
                    LocalDate expiringDate = version.getExpiringDate();
                    if (expiringDate != null) {
                        return expiringDate.minusDays(1)
                                .toDateTimeAtStartOfDay().toDate();
                    }
                    return null;
                }
            }, new Util.Setter<Date>() {
View Full Code Here


                    if (dateValidFrom != null) {
                        goToDate(dateValidFrom.toDateTimeAtStartOfDay()
                                .toDate());
                    } else if (expiringDate != null) {
                        goToDate(expiringDate.minusDays(1)
                                .toDateTimeAtStartOfDay().toDate());
                    } else {
                        goToDate(new Date());
                    }
                }
View Full Code Here

    @Test
    @Transactional
    public void taskWithUnviolatedDeadlineHasCorrectDeadlineViolationStatusMargin() {
        LocalDate now = new LocalDate();
        task.setDeadline(now);
        task.setEndDate(now.minusDays(1).toDateTimeAtStartOfDay().toDate());
        assertTrue(task.getDeadlineViolationStatus() ==
                TaskDeadlineViolationStatusEnum.ON_SCHEDULE);
    }

    private void prepareTaskForTheoreticalAdvanceTesting() {
View Full Code Here

    @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

    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

    @Override
    protected LocalDate doConvertToObject(String value, Locale locale) {
        try {
            final LocalDate dt = getFormatterForDatePattern().parseLocalDate(value);
            return dt.minusDays(adjustBy);
        } catch(IllegalArgumentException ex) {
            return null;
        }
    }
View Full Code Here

    private LocalDate interestCalculatedUpto() {
        LocalDate uptoMaturityDate = calculateMaturityDate();
        if (uptoMaturityDate != null) {
            // interest should not be calculated for maturity day
            uptoMaturityDate = uptoMaturityDate.minusDays(1);
        }
        return uptoMaturityDate;
    }

    private Money totalInterestPosted() {
View Full Code Here

    private LocalDate interestCalculatedUpto() {
        LocalDate uptoMaturityDate = calculateMaturityDate();
        if (uptoMaturityDate != null) {
            // interest should not be calculated for maturity day
            uptoMaturityDate = uptoMaturityDate.minusDays(1);
        }
        return uptoMaturityDate;
    }

    public void validateDomainRules() {
View Full Code Here

        while (!periodStartDate.isAfter(interestPostingUpToDate) && !periodEndDate.isAfter(interestPostingUpToDate)) {

            final LocalDate interestPostingLocalDate = determineInterestPostingPeriodEndDateFrom(periodStartDate, postingPeriodType,
                    interestPostingUpToDate, financialYearBeginningMonth);
            periodEndDate = interestPostingLocalDate.minusDays(1);

            postingPeriods.add(LocalDateInterval.create(periodStartDate, periodEndDate));

            periodEndDate = interestPostingLocalDate;
            periodStartDate = interestPostingLocalDate;
View Full Code Here

            diff = 0L;
        }
        LocalDate startDate = dueDate.plusDays(penaltyWaitPeriodValue.intValue() + 1);
        Integer frequencyNunber = 1;
        if (feeFrequency == null) {
            scheduleDates.put(frequencyNunber++, startDate.minusDays(diff.intValue()));
        } else {
            while (new LocalDate().isAfter(startDate)) {
                scheduleDates.put(frequencyNunber++, startDate.minusDays(diff.intValue()));
                LocalDate scheduleDate = scheduledDateGenerator.getRepaymentPeriodDate(PeriodFrequencyType.fromInt(feeFrequency),
                        chargeDefinition.feeInterval(), startDate);
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.