Examples of dayOfMonth()


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

    private void checkDate(final int year, final int month, final int day) {
        if ((month < 1) || (month > 12)) {
            throw new IllegalArgumentException("Month must be in the range 1 - 12 inclusive");
        }
        final DateTime newDate = newDateTime(year, month, 1);
        final int lastDayOfMonth = newDate.dayOfMonth().getMaximumValue();
        ;
        if ((day < 1) || (day > lastDayOfMonth)) {
            throw new IllegalArgumentException("Day must be in the range 1 - " + lastDayOfMonth + " inclusive: " + day);
        }
    }
View Full Code Here

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

    private void checkDate(final int year, final int month, final int day) {
        if ((month < 1) || (month > 12)) {
            throw new IllegalArgumentException("Month must be in the range 1 - 12 inclusive");
        }
        final DateTime newDate = newDateTime(year, month, 1);
        final int lastDayOfMonth = newDate.dayOfMonth().getMaximumValue();
        ;
        if ((day < 1) || (day > lastDayOfMonth)) {
            throw new IllegalArgumentException("Day must be in the range 1 - " + lastDayOfMonth + " inclusive: " + day);
        }
    }
View Full Code Here

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

   */
  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.MutableDateTime.dayOfMonth()

      return dateTime.toString(formatter);
    }

    public void setFirstDayOfMonth() {
      MutableDateTime dateTime = new MutableDateTime(this.timeInMillis);
      dateTime.setDayOfMonth(dateTime.dayOfMonth().getMinimumValue());
      this.timeInMillis = dateTime.getMillis();
    }

    public void setLastDayOfMonth() {
      MutableDateTime dateTime = new MutableDateTime(this.timeInMillis);
View Full Code Here

Examples of org.joda.time.YearMonthDay.dayOfMonth()

        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());
        }
    }

    public void testPartialGetAsText() {
        GJChronology chrono = GJChronology.getInstance(TOKYO);
View Full Code Here

Examples of org.joda.time.YearMonthDay.dayOfMonth()

        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());
        }
    }

    public void testLeap_28feb() {
        Chronology chrono = ISOChronology.getInstance();
View Full Code Here

Examples of org.jquantlib.time.Date.dayOfMonth()

    @Test
    public void isoDates() {
        QL.info("Testing ISO dates...");
        final String input_date = "2006-01-15";
        final Date d = DateParser.parseISO(input_date);
        if ((d.dayOfMonth() != 15) || (d.month() != Month.January) || (d.year() != 2006)) {
            fail("Iso date failed\n"
                    + " input date:    " + input_date + "\n"
                    + " day of month:  " + d.dayOfMonth() + "\n"
                    + " month:         " + d.month() + "\n"
                    + " year:          " + d.year());
View Full Code Here

Examples of org.jquantlib.time.Date.dayOfMonth()

        final String input_date = "2006-01-15";
        final Date d = DateParser.parseISO(input_date);
        if ((d.dayOfMonth() != 15) || (d.month() != Month.January) || (d.year() != 2006)) {
            fail("Iso date failed\n"
                    + " input date:    " + input_date + "\n"
                    + " day of month:  " + d.dayOfMonth() + "\n"
                    + " month:         " + d.month() + "\n"
                    + " year:          " + d.year());
        }
    }
View Full Code Here

Examples of org.jquantlib.time.Date.dayOfMonth()

            Date newD2 = dateEnd;
            Date temp = dateEnd;
            double sum = 0.0;
            while (temp.gt(dateStart)) {
                temp = newD2.add(Period.ONE_YEAR_BACKWARD);
                if (temp.dayOfMonth() == 28 && temp.month().value() == 2 && Date.isLeap(temp.year()))
                    temp.inc();
                if (temp.ge(dateStart)) {
                    sum += 1.0;
                    newD2 = temp;
                }
View Full Code Here

Examples of org.jquantlib.time.Date.dayOfMonth()

            Date newD2 = dateEnd;
            Date temp = dateEnd;
            double sum = 0.0;
            while (temp.gt(dateStart)) {
                temp = newD2.add(Period.ONE_YEAR_BACKWARD);
                if (temp.dayOfMonth() == 28 && temp.month().value() == 2 && Date.isLeap(temp.year()))
                    temp.inc();
                if (temp.ge(dateStart)) {
                    sum += 1.0;
                    newD2 = temp;
                }
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.