Package org.joda.time

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


    public void testRemoveOldPersistentTokens() {
        User admin = userRepository.findOne("admin");
        int existingCount = persistentTokenRepository.findByUser(admin).size();
        generateUserToken(admin, "1111-1111", new LocalDate());
        LocalDate now = new LocalDate();
        generateUserToken(admin, "2222-2222", now.minusDays(32));
        assertThat(persistentTokenRepository.findByUser(admin)).hasSize(existingCount + 2);
        userService.removeOldPersistentTokens();
        assertThat(persistentTokenRepository.findByUser(admin)).hasSize(existingCount + 1);
    }
View Full Code Here


      switch (ch.getType()) {
      case EASTER:
        break;
      case CLEAN_MONDAY:
      case SHROVE_MONDAY:
        easterSunday = easterSunday.minusDays(48);
        break;
      case MARDI_GRAS:
      case CARNIVAL:
        easterSunday = easterSunday.minusDays(47);
        break;
View Full Code Here

      case SHROVE_MONDAY:
        easterSunday = easterSunday.minusDays(48);
        break;
      case MARDI_GRAS:
      case CARNIVAL:
        easterSunday = easterSunday.minusDays(47);
        break;
      case ASH_WEDNESDAY:
        easterSunday = easterSunday.minusDays(46);
        break;
      case MAUNDY_THURSDAY:
View Full Code Here

      case MARDI_GRAS:
      case CARNIVAL:
        easterSunday = easterSunday.minusDays(47);
        break;
      case ASH_WEDNESDAY:
        easterSunday = easterSunday.minusDays(46);
        break;
      case MAUNDY_THURSDAY:
        easterSunday = easterSunday.minusDays(3);
        break;
      case GOOD_FRIDAY:
View Full Code Here

        break;
      case ASH_WEDNESDAY:
        easterSunday = easterSunday.minusDays(46);
        break;
      case MAUNDY_THURSDAY:
        easterSunday = easterSunday.minusDays(3);
        break;
      case GOOD_FRIDAY:
        easterSunday = easterSunday.minusDays(2);
        break;
      case EASTER_SATURDAY:
View Full Code Here

        break;
      case MAUNDY_THURSDAY:
        easterSunday = easterSunday.minusDays(3);
        break;
      case GOOD_FRIDAY:
        easterSunday = easterSunday.minusDays(2);
        break;
      case EASTER_SATURDAY:
        easterSunday = easterSunday.minusDays(1);
        break;
      case EASTER_MONDAY:
View Full Code Here

        break;
      case GOOD_FRIDAY:
        easterSunday = easterSunday.minusDays(2);
        break;
      case EASTER_SATURDAY:
        easterSunday = easterSunday.minusDays(1);
        break;
      case EASTER_MONDAY:
        easterSunday = easterSunday.plusDays(1);
        break;
      case EASTER_TUESDAY:
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

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

        timeLine.invalidAt(intervalStart, intervalEnd);
        timeLine.invalidAt(intervalStart.plusDays(2), intervalEnd.minusDays(2));

        assertFalse(timeLine.isValid(intervalEnd.minusDays(1)));
    }

    @Test
View Full Code Here

        LocalDate intervalEnd = contemporaryExample.plusDays(5);

        timeLine.invalidAt(intervalStart, intervalEnd);
        timeLine.invalidAt(intervalStart.plusDays(2), intervalEnd.minusDays(2));

        assertFalse(timeLine.isValid(intervalEnd.minusDays(1)));
    }

    @Test
    public void addingAnIntervalThatItsNotCompletelyInvalid() {
        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.