Package org.joda.time

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


        }
        return workableDays;
    }

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

    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

        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

        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

        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

                || 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

        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

        return values.get(days.getDays());
    }

    public void set(LocalDate day, T value) throws IndexOutOfBoundsException {
        Validate.notNull(day);
        Days days = Days.daysBetween(startInclusive, day);
        values.set(days.getDays(), value);
    }
View Full Code Here

     */
    public static boolean isDatesInRange(Date from, Date to, int days) {
        DateTime fromDate = new DateTime(from);
        DateTime toDate = new DateTime(to);

        Days d = Days.daysBetween(fromDate, toDate);
        return d.getDays() <= days;
    }
View Full Code Here

TOP

Related Classes of org.joda.time.Days

Copyright © 2018 www.massapicom. 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.