Package org.joda.time

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


    }

    public void testMaximumValue() {
        DateMidnight dt = new DateMidnight(1570, 1, 1, GJChronology.getInstance());
        while (dt.getYear() < 1590) {
            dt = dt.plusDays(1);
            YearMonthDay ymd = dt.toYearMonthDay();
            assertEquals(dt.year().getMaximumValue(), ymd.year().getMaximumValue());
            assertEquals(dt.monthOfYear().getMaximumValue(), ymd.monthOfYear().getMaximumValue());
            assertEquals(dt.dayOfMonth().getMaximumValue(), ymd.dayOfMonth().getMaximumValue());
        }
View Full Code Here


    }

    public void testMaximumValue() {
        DateMidnight dt = new DateMidnight(1570, 1, 1);
        while (dt.getYear() < 1590) {
            dt = dt.plusDays(1);
            YearMonthDay ymd = dt.toYearMonthDay();
            assertEquals(dt.year().getMaximumValue(), ymd.year().getMaximumValue());
            assertEquals(dt.monthOfYear().getMaximumValue(), ymd.monthOfYear().getMaximumValue());
            assertEquals(dt.dayOfMonth().getMaximumValue(), ymd.dayOfMonth().getMaximumValue());
        }
View Full Code Here

    }

    public void testMaximumValue() {
        DateMidnight dt = new DateMidnight(1570, 1, 1, GJChronology.getInstance());
        while (dt.getYear() < 1590) {
            dt = dt.plusDays(1);
            YearMonthDay ymd = dt.toYearMonthDay();
            assertEquals(dt.year().getMaximumValue(), ymd.year().getMaximumValue());
            assertEquals(dt.monthOfYear().getMaximumValue(), ymd.monthOfYear().getMaximumValue());
            assertEquals(dt.dayOfMonth().getMaximumValue(), ymd.dayOfMonth().getMaximumValue());
        }
View Full Code Here

    }

    public void testMaximumValue() {
        DateMidnight dt = new DateMidnight(1570, 1, 1);
        while (dt.getYear() < 1590) {
            dt = dt.plusDays(1);
            YearMonthDay ymd = dt.toYearMonthDay();
            assertEquals(dt.year().getMaximumValue(), ymd.year().getMaximumValue());
            assertEquals(dt.monthOfYear().getMaximumValue(), ymd.monthOfYear().getMaximumValue());
            assertEquals(dt.dayOfMonth().getMaximumValue(), ymd.dayOfMonth().getMaximumValue());
        }
View Full Code Here

        } else if (workingHours.getEnd().isBefore(now)) {
          // leave end of working hours as is
        }
      }
      duration = duration.plus(workingHours.toDuration());
      dateBeingProcessed = dateBeingProcessed.plusDays(1);
      processingInterval = getEntireDayIntervalForDate(dateBeingProcessed);
    }
    System.out.println(duration.toPeriod());
    return duration;
  }
View Full Code Here

            protected void callWithoutResult() {
                DateMidnight date = new DateMidnight(2012, 1, 1);
               
                for (int i = 0; i < 7; i++) {
                    dateDimensionDao.createDateDimension(date, 0, null);
                    date = date.plusDays(1);
                }
            }
        });
       
        this.execute(new CallableWithoutResult() {
View Full Code Here

        final DateMidnight start = form.getStart();
        final DateMidnight end = form.getEnd();
       
        final DateTime startDateTime = start.toDateTime();
        //Use a query end of the end date at 23:59:59
        final DateTime endDateTime = end.plusDays(1).toDateTime().minusSeconds(1);

        //Get the list of DateTimes used on the X axis in the report
        final List<DateTime> reportTimes = this.intervalHelper.getIntervalStartDateTimesBetween(interval, startDateTime, endDateTime, maxIntervals);

        final Map<D, SortedSet<T>> groupedAggregations = createColumnDiscriminatorMap(form);
View Full Code Here

            }
            else if (nextDate.isAfter(dimensionDate)) {
                do {
                    checkShutdown();
                    createDateDimension(quartersDetails, academicTermDetails, dimensionDate);
                    dimensionDate = dimensionDate.plusDays(1);
                } while (nextDate.isAfter(dimensionDate));
            }
           
            nextDate = dimensionDate.plusDays(1);
        }
View Full Code Here

                    createDateDimension(quartersDetails, academicTermDetails, dimensionDate);
                    dimensionDate = dimensionDate.plusDays(1);
                } while (nextDate.isAfter(dimensionDate));
            }
           
            nextDate = dimensionDate.plusDays(1);
        }
       
        //Add any missing dates from the tail
        while (nextDate.isBefore(end)) {
            checkShutdown();
View Full Code Here

    }

    private DateMidnight getWhenStartToApplyPenalty(final Event event, final DateTime when) {
        final GratuityEvent gratuityEvent = (GratuityEvent) event;
        final DateMidnight startDate = gratuityEvent.getRegistration().getStartDate().toDateMidnight();
        return startDate.plusDays(getNumberOfDaysToStartApplyingPenalty()).plusMonths(1).withDayOfMonth(1);
    }

    private int getNumberOfMonthsToChargePenalty(final Event event, final DateTime when) {
        final int numberOfMonths = (new Period(getWhenStartToApplyPenalty(event, when), when.toDateMidnight()).getMonths() + 1);
        return numberOfMonths < getMaxMonthsToApplyPenalty() ? numberOfMonths : getMaxMonthsToApplyPenalty();
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.