org.activityinfo.model.type.time.LocalDate.plusDays()方法的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(4.2k)|赞(0)|评价(0)|浏览(126)

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

LocalDate.plusDays介绍

暂无

代码示例

代码示例来源:origin: bedatadriven/activityinfo

@Override
public PeriodValue previous() {
  return plusDays(-1);
}

代码示例来源:origin: bedatadriven/activityinfo

@Override
public void advance(int count) {
  currentDay = currentDay.plusDays(count);
}

代码示例来源:origin: bedatadriven/activityinfo

public LocalDate previousDay() {
  return plusDays(-1);
}

代码示例来源:origin: bedatadriven/activityinfo

public LocalDate nextDay() {
  return plusDays(+1);
}

代码示例来源:origin: bedatadriven/activityinfo

@Override
public PeriodValue next() {
  return plusDays(1);
}

代码示例来源:origin: bedatadriven/activityinfo

@Override
public LocalDateInterval asInterval() {
  LocalDate firstDayOfYear = dayOfFirstEpiWeek(this.year);
  LocalDate firstDayOfWeek = firstDayOfYear.plusDays((this.weekInYear - 1) * 7);
  LocalDate lastDayOfWeek = firstDayOfWeek.plusDays(6);
  return new LocalDateInterval(firstDayOfWeek, lastDayOfWeek);
}

代码示例来源:origin: bedatadriven/activityinfo

@Override
public FieldValue apply(List<FieldValue> arguments) {
  LocalDate date = (LocalDate) arguments.get(0);
  Quantity days = (Quantity) arguments.get(1);
  return date.plusDays((int) days.getValue());
}

代码示例来源:origin: bedatadriven/activityinfo

@Override
public Tab get(int i) {
  return get(currentDay.plusDays(i));
}

代码示例来源:origin: bedatadriven/activityinfo

/**
 * @return the date after which the user should be again warned
 */
public LocalDate snoozeDate(Date now) {
  int daysLeft = daysUntilExpiration(now);
  LocalDate today = new LocalDate(now);
  if(trial) {
    if(daysLeft < 7) {
      return today.plusDays(1);
    } else {
      return today.plusDays(4);
    }
  } else {
    LocalDate expirationDay = new LocalDate(new Date(expirationTime * 1000L));
    int weeksLeft = Math.floorDiv(daysLeft, 7);
    if (weeksLeft <= 1) {
      return today.plusDays(1);
    } else if (weeksLeft <= 2) {
      return expirationDay.plusDays(-1 * DAYS_PER_WEEK);
    } else if (weeksLeft <= 3) {
      return expirationDay.plusDays(-2 * DAYS_PER_WEEK);
    } else if (weeksLeft <= 4) {
      return expirationDay.plusDays(-3 * DAYS_PER_WEEK);
    } else {
      return expirationDay.plusDays(-4 * DAYS_PER_WEEK);
    }
  }
}

代码示例来源:origin: bedatadriven/activityinfo

/**
 * @return the date after which the user should be nudged again for payment
 */
public LocalDate paymentSnoozeDate(Date now) {
  int daysLeft = daysUntilExpectedPayment(now);
  LocalDate today = new LocalDate(now);
  LocalDate expectedPaymentDay = new LocalDate(new Date(expirationTime * 1000L));
  if (daysLeft <= 3) {
    // Show each day for last three days prior to payment
    return today.plusDays(1);
  } else if (daysLeft <= 7) {
    // Show again on third day before payment
    return expectedPaymentDay.plusDays(-3);
  } else {
    // Show again next week
    return expectedPaymentDay.plusDays(-1 * DAYS_PER_WEEK);
  }
}

代码示例来源:origin: bedatadriven/activityinfo

@Override
public LocalDateInterval asInterval() {
  LocalDate startDate = startWeek.asInterval().getStartDate();
  LocalDate endDate = startDate.plusDays(13);
  return new LocalDateInterval(startDate, endDate);
}

代码示例来源:origin: bedatadriven/activityinfo

@Override
  public ColumnView columnApply(int numRows, List<ColumnView> arguments) {
    ColumnView dateView = arguments.get(0);
    ColumnView daysView = arguments.get(1);
    String[] result = new String[dateView.numRows()];
    for (int i = 0; i < dateView.numRows(); i++) {
      LocalDate date = LocalDate.parse(dateView.getString(i));
      int days = (int)daysView.getDouble(i);
      result[i] = date.plusDays(days).toString();
    }
    return new StringArrayColumnView(result);
  }
}

代码示例来源:origin: bedatadriven/activityinfo

@Test
public void dateEncoding() {
  LocalDate start = new LocalDate(1999, 11, 15);
  for (int i = 0; i < 400; i++) {
    checkRoundTrip(start.plusDays(i));
  }
}

代码示例来源:origin: bedatadriven/activityinfo

for (int j = 0; j < block.getBlockSize(); j++) {
    block.update(blockEntity, j, date);
    date = date.plusDays(1);
assertThat(view.numRows(), equalTo(block.getBlockSize() * 3 - 1));
assertThat(view.getString(0), equalTo(startDate.toString()));
assertThat(view.getString(1), equalTo(startDate.plusDays(1).toString()));
assertThat(view.getString(2), equalTo(startDate.plusDays(3).toString()));
assertThat(view.getString(3), equalTo(startDate.plusDays(4).toString()));
assertThat(view.getString(block.getBlockSize()), equalTo(startDate.plusDays(block.getBlockSize() + 1).toString()));
assertThat(selected.getString(0), equalTo(startDate.plusDays(1).toString()));

相关文章