Package org.joda.time

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


        LocalDate start = new LocalDate(2009, 10, 20);
        givenDayAssignments(start, 8, 8, 8, 4);

        Machine otherMachine = Machine.create();
        dayAssignments
                .add(createAssignment(start.plusDays(5), otherMachine, 8));

        DerivedAllocation derivedAllocation = DerivedAllocationGenerator
                .generate(derivedFrom, finder, configurationUnit,
                        dayAssignments);
        List<DerivedDayAssignment> assignments = derivedAllocation
View Full Code Here


        LocalDate currentDate = new LocalDate();
        BigDecimal currentValue = new BigDecimal(10);

        for (int i = 0; i < iterations; i++) {
            values.put(currentDate, currentValue);
            currentDate = currentDate.plusDays(separatorDay);
            currentValue = currentValue.add(separatorPercentage);
            if (currentValue.compareTo(new BigDecimal(100)) >= 0) {
                break;
            }
        }
View Full Code Here

            EffortDuration workableTime = calendar.getCapacityOn(PartialDay
                    .wholeDay(day));
            if (!EffortDuration.zero().equals(workableTime)) {
                i++;
            }
            day = day.plusDays(1);
        }
        return day;
    }

    private Task task;
View Full Code Here

                TaskElement.minDate(rootTask.getChildren()).getDate(), endDate);

        LocalDate deadLineAsLocalDate = LocalDate.fromDateFields(currentOrder
                .getDeadline());
        Days deadlineOffset = Days.daysBetween(endDate,
                deadLineAsLocalDate.plusDays(1));

        BigDecimal outcome = new BigDecimal(deadlineOffset.getDays(),
                MathContext.DECIMAL32);
        this.marginWithDeadLine = outcome.divide(
                new BigDecimal(orderDuration.getDays()), 8,
View Full Code Here

    public IntraDayDate getFirstDayNotConsolidated() {
        if (consolidation != null) {
            LocalDate until = consolidation.getConsolidatedUntil();
            if (until != null) {
                return IntraDayDate.startOfDay(until.plusDays(1));
            }
        }
        return getIntraDayStartDate();
    }
View Full Code Here

        LocalDate min = Collections.min(assignments,
                DayAssignment.byDayComparator()).getDay();
        LocalDate max = Collections.max(assignments,
                DayAssignment.byDayComparator()).getDay();
        Set<LocalDate> daysPresent = DayAssignment.byDay(
                getAssignments(min, max.plusDays(1))).keySet();

        List<T> result = new ArrayList<T>();
        for (T each : assignments) {
            if (!daysPresent.contains(each.getDay())) {
                result.add(each);
View Full Code Here

        }
    }

    private Date plusDays(Date date, Integer days) {
        LocalDate localDate = new LocalDate(date);
        return localDate.plusDays(days).toDateTimeAtStartOfDay().toDate();
    }

    private void setupCriterionRequirements(OrderElement orderElement) {
        for (DirectCriterionRequirement each : getDirectCriterionRequirements()) {
            if (orderElement.canAddCriterionRequirement(each)) {
View Full Code Here

        }

        private LocalDate afterSomeWorkableDays(LocalDate start,
                int workableDays) {
            LocalDate result = start;
            for (int i = 0; i < workableDays; result = result.plusDays(1)) {
                if (isWorkable(result)) {
                    i++;
                }
            }
            return result;
View Full Code Here

            while (!remaining.isZero()) {
                EffortDuration capacity = calendar.getCapacityOn(PartialDay
                        .wholeDay(current));
                result = IntraDayDate.create(current, remaining);
                remaining = remaining.minus(min(capacity, remaining));
                current = current.plusDays(1);
                if (Days.daysBetween(startDate, current).getDays() > MAX_DAYS_LOOKING_CAPACITY) {
                    LOG.error("thereAreCapacityFor didn't detect that it didn't"
                            + " really have enough capacity to fulfill the required hours"
                            + " or this capacity is more than "
                            + MAX_DAYS_LOOKING_CAPACITY + " in the future");
View Full Code Here

        givenTaskWithStartAndEnd(toInterval(start,
                Period.days(TASK_DURATION_DAYS)));
        givenGenericResourceAllocationForTask(task);
        givenWorkersWithLoads(
                LoadSpec.withHours(3)
                        .withException(start.plusDays(1), hours(1))
                        .withException(start.plusDays(3), hours(8)),
                LoadSpec.withHours(12).withException(start.plusDays(3), zero()),
                LoadSpec.withHours(1)
                        .withException(start.plusDays(1), hours(3))
                        .withException(start.plusDays(3), hours(8)));
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.