Package org.joda.time

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


      case WHIT_SUNDAY:
        easterSunday = easterSunday.plusDays(49);
        break;
      case WHIT_MONDAY:
      case PENTECOST_MONDAY:
        easterSunday = easterSunday.plusDays(50);
        break;
      case CORPUS_CHRISTI:
        easterSunday = easterSunday.plusDays(60);
        break;
      case SACRED_HEART:
View Full Code Here


      case WHIT_MONDAY:
      case PENTECOST_MONDAY:
        easterSunday = easterSunday.plusDays(50);
        break;
      case CORPUS_CHRISTI:
        easterSunday = easterSunday.plusDays(60);
        break;
      case SACRED_HEART:
        easterSunday = easterSunday.plusDays(68);
        break;
      default:
View Full Code Here

        break;
      case CORPUS_CHRISTI:
        easterSunday = easterSunday.plusDays(60);
        break;
      case SACRED_HEART:
        easterSunday = easterSunday.plusDays(68);
        break;
      default:
        throw new IllegalArgumentException(
            "Unknown christian holiday type " + ch.getType());
      }
View Full Code Here

        continue;
      }
      LocalDate date = parse(year, rtfw.getFixedWeekday());
      int direction = (rtfw.getWhen() == When.BEFORE ? -1 : 1);
      while (date.getDayOfWeek() != xmlUtil.getWeekday(rtfw.getWeekday())) {
        date = date.plusDays(direction);
      }
      HolidayType type = xmlUtil.getType(rtfw.getLocalizedType());
      holidays.add(new Holiday(date, rtfw.getDescriptionPropertiesKey(), type));
    }
  }
View Full Code Here

    for (RelativeToEasterSunday ch : config.getRelativeToEasterSunday()) {
      if (!isValid(ch, year)) {
        continue;
      }
      LocalDate easterSunday = getEasterSunday(year, ch.getChronology());
      easterSunday.plusDays(ch.getDays());
      String propertiesKey = PREFIX_PROPERTY_CHRISTIAN + ch.getDescriptionPropertiesKey();
      addChrstianHoliday(easterSunday, propertiesKey, ch.getLocalizedType(), holidays);
    }
  }
View Full Code Here

        continue;
      }
      LocalDate day = calendarUtil.create(year, f.getDay());
      day = moveDateToFirstOccurenceOfWeekday(f, day);
      int days = determineNumberOfDays(f);
      day = f.getWhen() == When.AFTER ? day.plusDays(days) : day.minusDays(days);
      HolidayType type = xmlUtil.getType(f.getLocalizedType());
      holidays.add(new Holiday(day, f.getDescriptionPropertiesKey(), type));
    }
  }
View Full Code Here

      if (rf.getWeekday() != null) {
        // if weekday is set -> move to weekday
        int day = xmlUtil.getWeekday(rf.getWeekday());
        int direction = (rf.getWhen() == When.BEFORE ? -1 : 1);
        do {
          fixed = fixed.plusDays(direction);
        } while (fixed.getDayOfWeek() != day);
      } else if (rf.getDays() != null) {
        // if number of days set -> move number of days
        fixed = fixed.plusDays(rf.getWhen() == When.BEFORE ? -rf.getDays() : rf.getDays());
      }
View Full Code Here

        AvailabilityTimeLine timeLine = AvailabilityTimeLine.allValid();
        LocalDate intervalStart = contemporaryExample.minusDays(10);
        LocalDate intervalEnd = contemporaryExample.plusDays(5);

        timeLine.invalidAt(intervalStart, intervalEnd);
        timeLine.invalidAt(intervalStart.minusDays(3), intervalEnd.plusDays(4));

        assertFalse(timeLine.isValid(intervalStart.minusDays(3)));
        assertFalse(timeLine.isValid(intervalEnd));
        assertFalse(timeLine.isValid(intervalEnd.plusDays(3)));
        assertTrue(timeLine.isValid(intervalEnd.plusDays(4)));
View Full Code Here

        timeLine.invalidAt(intervalStart, intervalEnd);
        timeLine.invalidAt(intervalStart.minusDays(3), intervalEnd.plusDays(4));

        assertFalse(timeLine.isValid(intervalStart.minusDays(3)));
        assertFalse(timeLine.isValid(intervalEnd));
        assertFalse(timeLine.isValid(intervalEnd.plusDays(3)));
        assertTrue(timeLine.isValid(intervalEnd.plusDays(4)));
    }

    @Test
    public void addingAnIntervalThatJoinsTwoInvalidIntervals() {
View Full Code Here

        timeLine.invalidAt(intervalStart.minusDays(3), intervalEnd.plusDays(4));

        assertFalse(timeLine.isValid(intervalStart.minusDays(3)));
        assertFalse(timeLine.isValid(intervalEnd));
        assertFalse(timeLine.isValid(intervalEnd.plusDays(3)));
        assertTrue(timeLine.isValid(intervalEnd.plusDays(4)));
    }

    @Test
    public void addingAnIntervalThatJoinsTwoInvalidIntervals() {
        AvailabilityTimeLine timeLine = AvailabilityTimeLine.allValid();
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.