Examples of Days


Examples of org.joda.time.Days

    public Duration getLengthBetween() {
        return lengthBetween;
    }

    public Fraction getProportion(DateTime date) {
        Days fromStartToDate = Days.daysBetween(startInclusive,
                date.toLocalDate());
        Fraction result = Fraction.getFraction(fromStartToDate.getDays(),
                this.daysBetween.getDays());
        try {
            return result.add(inTheDayIncrement(date));
        } catch (ArithmeticException e) {
            return result;
View Full Code Here

Examples of org.joda.time.Days

    public static BigDecimal calculateRealDurationFor(MonteCarloTask task, BigDecimal daysDuration) {
        LocalDate start = task.getStartDate();
        Validate.notNull(start);
        LocalDate end = calculateEndDateFor(task, daysDuration);
        Days daysBetween = Days.daysBetween(start, end);
        return BigDecimal.valueOf(daysBetween.getDays());
    }
View Full Code Here

Examples of org.joda.time.Days

            return;
        }
        TaskGroup rootTask = getRootTask();
        LocalDate endDate = TaskElement.maxDate(rootTask.getChildren())
                .asExclusiveEnd();
        Days orderDuration = Days.daysBetween(
                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,
                BigDecimal.ROUND_HALF_EVEN);
    }
View Full Code Here

Examples of org.joda.time.Days

        }
        return workableDays;
    }

    public Integer getDaysBetweenDates() {
        Days daysBetween = Days.daysBetween(getStartAsLocalDate(),
                getIntraDayEndDate().asExclusiveEnd());
        return daysBetween.getDays();
    }
View Full Code Here

Examples of org.joda.time.Days

    public static <T extends OrderElementTemplate> T create(T beingBuilt,
            OrderElement origin) {
        InfoComponent infoComponentCopied = origin.getInfoComponent().copy();
        Order order = origin.getOrder();
        Days fromBeginningToStart = daysBetween(order.getInitDate(), origin
                .getInitDate());
        Days fromBeginningToEnd = daysBetween(order.getInitDate(), origin
                .getDeadline());
        beingBuilt.setMaterialAssignments(copyMaterialAssignmentsFrom(beingBuilt, origin
                .getMaterialAssignments()));
        beingBuilt.setCriterionRequirements(copyDirectCriterionRequirements(
                beingBuilt, origin.getDirectCriterionRequirement()));
View Full Code Here

Examples of org.joda.time.Days

        DateTime endDate = toDateTime(getStartDate()).plusDays(duration);
        setEndDate(endDate.toDate());
    }

    public Integer getDaysDuration() {
        Days daysBetween = Days.daysBetween(toDateTime(getStartDate()),
                toDateTime(getEndDate()));
        return daysBetween.getDays();
    }
View Full Code Here

Examples of org.joda.time.Days

        return daysUntil(new UntilEnd(endExclusive));
    }

    public int numberOfDaysUntil(IntraDayDate end) {
        Validate.isTrue(compareTo(end) <= 0);
        Days daysBetween = Days.daysBetween(getDate(), end.getDate());
        if (getEffortDuration().compareTo(end.getEffortDuration()) <= 0) {
            return daysBetween.getDays();
        } else {
            return daysBetween.getDays() - 1;
        }
    }
View Full Code Here

Examples of org.joda.time.Days

        if (fromInclusive.isAfter(endExclusive)) {
            throw new IllegalArgumentException("fromInclusive ("
                    + fromInclusive + ") is after endExclusive ("
                    + endExclusive + ")");
        }
        Days daysBetween = Days.daysBetween(fromInclusive, endExclusive);
        return new ContiguousDaysLine<T>(fromInclusive, daysBetween.getDays());
    }
View Full Code Here

Examples of org.joda.time.Days

                || startInclusive.compareTo(getEndExclusive()) >= 0
                || endExclusive.compareTo(getStart()) <= 0) {
            return invalid();
        }
        LocalDate newStart = max(this.startInclusive, startInclusive);
        Days days = Days.daysBetween(newStart,
                min(getEndExclusive(), endExclusive));
        ContiguousDaysLine<T> result = new ContiguousDaysLine<T>(newStart,
                days.getDays());
        for (OnDay<T> each : result) {
            result.set(each.getDay(), this.get(each.getDay()));
        }
        return result;
    }
View Full Code Here

Examples of org.joda.time.Days

        return getStart().plusDays(values.size());
    }

    public T get(LocalDate day) throws IndexOutOfBoundsException {
        Validate.notNull(day);
        Days days = Days.daysBetween(startInclusive, day);
        return values.get(days.getDays());
    }
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.