Examples of withDayOfMonth()


Examples of org.joda.time.DateTime.withDayOfMonth()

    public void testTruncateDate()
    {
        DateTime result = DATE;
        assertFunction("date_trunc('day', " + DATE_LITERAL + ")", toDate(result));

        result = result.withDayOfMonth(20);
        assertFunction("date_trunc('week', " + DATE_LITERAL + ")", toDate(result));

        result = result.withDayOfMonth(1);
        assertFunction("date_trunc('month', " + DATE_LITERAL + ")", toDate(result));
View Full Code Here

Examples of org.joda.time.DateTime.withDayOfMonth()

        assertFunction("date_trunc('day', " + DATE_LITERAL + ")", toDate(result));

        result = result.withDayOfMonth(20);
        assertFunction("date_trunc('week', " + DATE_LITERAL + ")", toDate(result));

        result = result.withDayOfMonth(1);
        assertFunction("date_trunc('month', " + DATE_LITERAL + ")", toDate(result));

        result = result.withMonthOfYear(7);
        assertFunction("date_trunc('quarter', " + DATE_LITERAL + ")", toDate(result));
View Full Code Here

Examples of org.joda.time.DateTime.withDayOfMonth()

    }

    private DateTime next(DateTime date)
    {
        DateTime next = date.plusMonths(interval);
        next = next.withDayOfMonth(Math.min(next.dayOfMonth().getMaximumValue(), new DateTime(start).getDayOfMonth()));
        return next;
    }

    public List<PortfolioTransaction> generateTransactions()
    {
View Full Code Here

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

   */
  protected LocalDate parse(int year, FixedWeekdayInMonth fwm) {
    LocalDate date = calendarUtil.create(year, xmlUtil.getMonth(fwm.getMonth()), 1);
    int direction = 1;
    if (fwm.getWhich() == Which.LAST) {
      date = date.withDayOfMonth(date.dayOfMonth().getMaximumValue());
      direction = -1;
    }
    date = moveToNextRequestedWeekdayByDirection(fwm, date, direction);
    date = moveNumberOfRequestedWeeks(fwm, date);
    return date;
View Full Code Here

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

        // MAKE 1
        List fromDateList = (List) loanSchedule.get(1).get("fromDate");
        LocalDate fromDateLocal = LocalDate.now();
        fromDateLocal = fromDateLocal.withYear((int) fromDateList.get(0));
        fromDateLocal = fromDateLocal.withMonthOfYear((int) fromDateList.get(1));
        fromDateLocal = fromDateLocal.withDayOfMonth((int) fromDateList.get(2));

        List dueDateList = (List) loanSchedule.get(1).get("dueDate");
        LocalDate dueDateLocal = LocalDate.now();
        dueDateLocal = dueDateLocal.withYear((int) dueDateList.get(0));
        dueDateLocal = dueDateLocal.withMonthOfYear((int) dueDateList.get(1));
View Full Code Here

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

        List dueDateList = (List) loanSchedule.get(1).get("dueDate");
        LocalDate dueDateLocal = LocalDate.now();
        dueDateLocal = dueDateLocal.withYear((int) dueDateList.get(0));
        dueDateLocal = dueDateLocal.withMonthOfYear((int) dueDateList.get(1));
        dueDateLocal = dueDateLocal.withDayOfMonth((int) dueDateList.get(2));

        int totalDaysInPeriod = Days.daysBetween(fromDateLocal, dueDateLocal).getDays();

        float totalInterest = (float) loanSchedule.get(1).get("interestOriginalDue");
        DecimalFormat numberFormat = new DecimalFormat("#.00", new DecimalFormatSymbols(Locale.US));
View Full Code Here

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

        // MAKE 1
        List fromDateList = (List) loanSchedule.get(1).get("fromDate");
        LocalDate fromDateLocal = LocalDate.now();
        fromDateLocal = fromDateLocal.withYear((int) fromDateList.get(0));
        fromDateLocal = fromDateLocal.withMonthOfYear((int) fromDateList.get(1));
        fromDateLocal = fromDateLocal.withDayOfMonth((int) fromDateList.get(2));

        List dueDateList = (List) loanSchedule.get(1).get("dueDate");
        LocalDate dueDateLocal = LocalDate.now();
        dueDateLocal = dueDateLocal.withYear((int) dueDateList.get(0));
        dueDateLocal = dueDateLocal.withMonthOfYear((int) dueDateList.get(1));
View Full Code Here

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

        List dueDateList = (List) loanSchedule.get(1).get("dueDate");
        LocalDate dueDateLocal = LocalDate.now();
        dueDateLocal = dueDateLocal.withYear((int) dueDateList.get(0));
        dueDateLocal = dueDateLocal.withMonthOfYear((int) dueDateList.get(1));
        dueDateLocal = dueDateLocal.withDayOfMonth((int) dueDateList.get(2));

        int totalDaysInPeriod = Days.daysBetween(fromDateLocal, dueDateLocal).getDays();

        float totalInterest = (float) loanSchedule.get(1).get("interestOriginalDue");
        DecimalFormat numberFormat = new DecimalFormat("#.00", new DecimalFormatSymbols(Locale.US));
View Full Code Here

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

            if (recurrenceType.isPeriodicRecurrence()) {
                final ScheduledDateGenerator scheduledDateGenerator = new DefaultScheduledDateGenerator();
                PeriodFrequencyType frequencyType = data.recurrenceFrequency();
                LocalDate startDate = data.validFrom();
                if (frequencyType.isMonthly()) {
                    startDate = startDate.withDayOfMonth(data.recurrenceOnDay());
                    if (startDate.isBefore(data.validFrom())) {
                        startDate = startDate.plusMonths(1);
                    }
                } else if (frequencyType.isYearly()) {
                    startDate = startDate.withDayOfMonth(data.recurrenceOnDay()).withMonthOfYear(data.recurrenceOnMonth());
View Full Code Here

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

                    startDate = startDate.withDayOfMonth(data.recurrenceOnDay());
                    if (startDate.isBefore(data.validFrom())) {
                        startDate = startDate.plusMonths(1);
                    }
                } else if (frequencyType.isYearly()) {
                    startDate = startDate.withDayOfMonth(data.recurrenceOnDay()).withMonthOfYear(data.recurrenceOnMonth());
                    if (startDate.isBefore(data.validFrom())) {
                        startDate = startDate.plusYears(1);
                    }
                }
                isDueForTransfer = scheduledDateGenerator.isDateFallsInSchedule(frequencyType, data.recurrenceInterval(), 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.