Date date = new Date(getYear() - 1900, getMonthOfYear() - 1, dom); LocalDate check = LocalDate.fromDateFields(date); if (check.isBefore(this)) {
Date date = new Date(getYear() - 1900, getMonthOfYear() - 1, dom); LocalDate check = LocalDate.fromDateFields(date); if (check.isBefore(this)) {
Date date = new Date(getYear() - 1900, getMonthOfYear() - 1, dom); LocalDate check = LocalDate.fromDateFields(date); if (check.isBefore(this)) {
/** * @param date primary date * @param compareDate date to compare to * @return true if date is before compareDate */ protected final boolean isBefore(final LocalDate date, final LocalDate compareDate) { return date.isBefore(compareDate); }
public String validateChangeDates( final LocalDate startDate, final LocalDate endDate) { if (startDate != null && endDate != null && !startDate.isBefore(endDate)) { return "End date must be after start date"; } return null; } }
public void updateResponseLastCapturedDate(LocalDate lastCapturedDate) { if (responseLastCapturedDate == null || responseLastCapturedDate.isBefore(lastCapturedDate)) { responseLastCapturedDate = lastCapturedDate; } }
public boolean isValid(LocalDate value, ConstraintValidatorContext constraintValidatorContext) { //null values are valid if ( value == null ) { return true; } return (value).isBefore(new LocalDate(new Date())); } }
private LocalDate getSelectDate(LocalDate localDate) { if (localDate.isBefore(startDate)) { return startDate; } else if (localDate.isAfter(endDate)) { return endDate; } else { return localDate; } }
final public RegistrationState getStateInDate(final LocalDate localDate) { final List<RegistrationState> sortedRegistrationStates = new ArrayList<RegistrationState>(getRegistrationStatesSet()); Collections.sort(sortedRegistrationStates, RegistrationState.DATE_COMPARATOR); for (ListIterator<RegistrationState> iterator = sortedRegistrationStates.listIterator(sortedRegistrationStates.size()); iterator .hasPrevious();) { RegistrationState registrationState = iterator.previous(); if (!localDate.isBefore(registrationState.getStateDate().toLocalDate())) { return registrationState; } } return null; }
public boolean isActiveAt( @NotNull LocalDate date ) { if ( !getBegin().isBefore( date ) ) { return false; } LocalDate theEnd = end; if ( theEnd == null ) { return true; } else { return theEnd.isAfter( date ); } }
@TargetApi(11) public void setMinDate(LocalDate date) { mMinDate = date; if(date != null && mMaxDate != null && mMaxDate.isBefore(date)) throw new IllegalArgumentException("Requested min date " + date + " is before max date " + mMaxDate); if(mMinDate != null) mPicker.setMinDate(mMinDate.toDate().getTime()); updateMessage(); }
private String getYearKey(LocalDate leaveDate, LeavePlan lp){ String yearKey = Integer.toString(leaveDate.getYear()); LocalDate leavePlanDate = new LocalDate(leaveDate.getYear(), Integer.parseInt(lp.getCalendarYearStartMonth()), Integer.parseInt(lp.getCalendarYearStartDayOfMonth())); if (leaveDate.isBefore(leavePlanDate)) { yearKey = Integer.toString(leaveDate.getYear() - 1); } return yearKey; }
@Override protected void checkBoundary(final LocalDate date) { final LocalDate early = getHolidayCalendar().getEarlyBoundary(); if (early != null && early.isAfter(date)) { throw new IndexOutOfBoundsException(date + " is before the early boundary " + early); } final LocalDate late = getHolidayCalendar().getLateBoundary(); if (late != null && late.isBefore(date)) { throw new IndexOutOfBoundsException(date + " is after the late boundary " + late); } }
private List<WebHookHistoryItem> findAllItemsSince(LocalDate untilDate, int numberOfDays) { List<WebHookHistoryItem> erroredItemsSince = new ArrayList<>(); LocalDate sinceDate = untilDate.minusDays(numberOfDays); for (WebHookHistoryItem item : this.webHookHistoryItems.values()) { LocalDate itemTimeStamp = item.getTimestamp().toLocalDate(); if (sinceDate.isBefore(itemTimeStamp) && untilDate.isAfter(itemTimeStamp)) { erroredItemsSince.add(item); } } return erroredItemsSince; }
public void deletAll(final LocalDate until) { for(PathFinder pathFinder : pathFinder(until)) { if(pathFinder.getDate().isBefore(until)) { delete(pathFinder); } else { break; } } }
public void compressAll(final LocalDate until) { for(PathFinder pathFinder : pathFinder(until)) { if(pathFinder.getDate().isBefore(until)) { compress(pathFinder); } else { break; } } }
@Override protected void checkBoundary(final LocalDate date) { final LocalDate early = getHolidayCalendar().getEarlyBoundary(); if (early != null && early.isAfter(date)) { throw new IndexOutOfBoundsException(date + " is before the early boundary " + early); } final LocalDate late = getHolidayCalendar().getLateBoundary(); if (late != null && late.isBefore(date)) { throw new IndexOutOfBoundsException(date + " is after the late boundary " + late); } }
/** * Make constructor private so it can only be created by factory method. */ private DateRangeAndType( LocalDate startDate, LocalDate endDate, ReportDefinitionDateRangeType type) { this.startDate = Preconditions.checkNotNull(startDate, "Argument 'startDate' cannot be null."); this.endDate = Preconditions.checkNotNull(endDate, "Argument 'endDate' cannot be null."); this.type = Preconditions.checkNotNull(type, "Argument 'type' cannot be null."); Preconditions.checkArgument( !endDate.isBefore(startDate), "Start date must be before or equal to end date."); }
public boolean contains(LocalDate date) { LocalDate start = new LocalDate(date.getYear(), getMonthStart(), getDayStart()); LocalDate end = new LocalDate(date.getYear(), getMonthEnd(), getDayEnd()); if ((date.equals(start) || date.isAfter(start)) && (date.equals(end) || date.isBefore(end))) { return true; } else { return false; } }
protected void validate( @NotNull E entry ) throws InvalidEntryException { if ( findEntryWithBegin( entry.getBegin() ) != null ) { throw new InvalidEntryException( "An entry with the same begin still exists " + entry.getBegin() ); } if ( entry.getBegin().isBefore( getBegin() ) ) { throw new InvalidEntryException( "Begin date does not fit. <" + entry.getBegin() + "> is before <" + getBegin() + ">" ); } if ( entry.getBegin().isAfter( getEnd() ) ) { throw new InvalidEntryException( "End date is too late. <" + entry.getBegin() + "> is after <" + getEnd() + '>' ); } }