org.joda.time.LocalDate.isBefore()方法的使用及代码示例

x33g5p2x  于2022-01-23 转载在 其他  
字(7.0k)|赞(0)|评价(0)|浏览(172)

本文整理了Java中org.joda.time.LocalDate.isBefore()方法的一些代码示例,展示了LocalDate.isBefore()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。LocalDate.isBefore()方法的具体详情如下:
包路径:org.joda.time.LocalDate
类名称:LocalDate
方法名:isBefore

LocalDate.isBefore介绍

暂无

代码示例

代码示例来源:origin: joda-time/joda-time

Date date = new Date(getYear() - 1900, getMonthOfYear() - 1, dom);
LocalDate check = LocalDate.fromDateFields(date);
if (check.isBefore(this)) {

代码示例来源:origin: JodaOrg/joda-time

Date date = new Date(getYear() - 1900, getMonthOfYear() - 1, dom);
LocalDate check = LocalDate.fromDateFields(date);
if (check.isBefore(this)) {

代码示例来源:origin: camunda/camunda-bpm-platform

Date date = new Date(getYear() - 1900, getMonthOfYear() - 1, dom);
LocalDate check = LocalDate.fromDateFields(date);
if (check.isBefore(this)) {

代码示例来源:origin: org.schoellerfamily.gedbrowser/gedbrowser-analytics

/**
 * @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);
}

代码示例来源:origin: org.incode.module.base/incode-module-base-dom

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

代码示例来源:origin: org.motechproject/motech-pillreminder-api

public void updateResponseLastCapturedDate(LocalDate lastCapturedDate) {
  if (responseLastCapturedDate == null || responseLastCapturedDate.isBefore(lastCapturedDate)) {
    responseLastCapturedDate = lastCapturedDate;
  }
}

代码示例来源:origin: org.fornax.cartridges/fornax-cartridges-sculptor-framework

public boolean isValid(LocalDate value, ConstraintValidatorContext constraintValidatorContext) {
    //null values are valid
    if ( value == null ) {
      return true;
    }
    return (value).isBefore(new LocalDate(new Date()));
  }
}

代码示例来源:origin: yannecer/NCalendar

private LocalDate getSelectDate(LocalDate localDate) {
  if (localDate.isBefore(startDate)) {
    return startDate;
  } else if (localDate.isAfter(endDate)) {
    return endDate;
  } else {
    return localDate;
  }
}

代码示例来源:origin: FenixEdu/fenixedu-academic

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

代码示例来源:origin: com.cedarsoft.utils.history/core

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

代码示例来源:origin: jclehner/rxdroid

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

代码示例来源:origin: org.kuali.kpme/kpme-tk-lm-impl

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

代码示例来源:origin: net.objectlab.kit/datecalc-joda

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

代码示例来源:origin: tcplugins/tcWebHooks

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

代码示例来源:origin: de.ck35.metricstore/metricstore-fs

public void deletAll(final LocalDate until) {
  for(PathFinder pathFinder : pathFinder(until)) {
    if(pathFinder.getDate().isBefore(until)) {
      delete(pathFinder);
    } else {
      break;
    }
  }
}

代码示例来源:origin: de.ck35.metricstore/metricstore-fs

public void compressAll(final LocalDate until) {
  for(PathFinder pathFinder : pathFinder(until)) {
    if(pathFinder.getDate().isBefore(until)) {
      compress(pathFinder);
    } else {
      break;
    }
  }
}

代码示例来源:origin: Appendium/objectlabkit

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

代码示例来源:origin: googleads/aw-reporting

/**
 * 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.");
}

代码示例来源:origin: FenixEdu/fenixedu-academic

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

代码示例来源:origin: com.cedarsoft.utils.history/core

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

相关文章