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

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

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

LocalDate.<init>介绍

暂无

代码示例

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

@Override
  public LocalDate getLastUsedDate() {
    return new LocalDate();
  }
}

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

public static LocalDateInterval year(int year) {
  return new LocalDateInterval(
      new LocalDate(year, 1, 1),
      new LocalDate(year, 12, 31));
}

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

@Override
public FieldValue toFieldValue(ResultSet rs, int index) throws SQLException {
  java.sql.Date date = rs.getDate(index);
  if(date == null) {
    return null;
  }
  return new LocalDate(date);
}

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

@Override
  public LocalDateInterval asInterval() {
    return new LocalDateInterval(
        new LocalDate(year, month, 1),
        new LocalDate(year, month, LocalDate.getLastDayOfMonth(year, month)));
  }
}

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

@Override
public FieldValue apply(List<FieldValue> arguments) {
  if(arguments.size() != 0) {
    throw new FormulaSyntaxException("The TODAY() function doesn't take any arguments");
  }
  return new LocalDate(new Date());
}

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

@SuppressWarnings("deprecation")
public static LocalDate fromDayOfYear(int year, int dayOfYear) {
  // Use deprecated Date API because it compiles directly to Javascript builtin.
  Date jan1 = new LocalDate(year, 1, 1).atMidnightInMyTimezone();
  jan1.setDate(dayOfYear);
  return new LocalDate(jan1);
}

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

@Override
  public ColumnView columnApply(int numRows, List<ColumnView> arguments) {
    return new ConstantColumnView(numRows, new LocalDate(new Date()).toString());
  }
}

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

private FieldInput input() {
  if(field.isValid()) {
    if(field.getValue() == null) {
      return FieldInput.EMPTY;
    } else {
      return new FieldInput(new LocalDate(field.getValue()));
    }
  } else {
    return FieldInput.INVALID_INPUT;
  }
}

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

private LocalDate toDate(int[] components, int yearIndex, int monthIndex, int dayIndex) {
  int year = components[yearIndex];
  if(isTwoDigits(year)) {
    year += inferCentury(year);
  }
  return new LocalDate(year, components[monthIndex], components[dayIndex]);
}

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

@Test
public void zeroYear() {
  try {
    LocalDate zeroYearDate = new LocalDate(0,1,1);
    throw new AssertionError("Should not be able to enter zero years (i.e. 1 BCE)");
  } catch (IllegalStateException excp) { /* Good - prevented from entering zero years */ }
}

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

@SuppressWarnings("deprecation")
public LocalDate plusDays(int count) {
  // Use deprecated Date API because it compiles directly to Javascript builtin.
  Date date = atMidnightInMyTimezone();
  date.setDate(date.getDate() + count);
  return new LocalDate(date);
}

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

@Test
public void evaluation() {
  LocalDate x = new LocalDate(2016, 1, 1);
  LocalDate y = new LocalDate(2017, 1, 1);
  Quantity z = (Quantity) YearFracFunction.INSTANCE.apply(Arrays.<FieldValue>asList(x, y));
  assertThat(z, equalTo(new Quantity(1.0)));
}

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

private void assertFirstDayOfEpicWeekInYear(int year, int expectedYear, int expectedMonth, int expectedDayOfMonth) {
    assertThat("Year " + year, EpiWeek.dayOfFirstEpiWeek(year),
        equalTo(new LocalDate(expectedYear, expectedMonth, expectedDayOfMonth)));
  }
}

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

private void onDatePicked(ValueChangeEvent<Date> event) {
  LocalDate date = new LocalDate(event.getValue());
  dateMenu.hide();
  updater.update(new FieldInput(periodType.containingDate(date)));
}

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

@Test
public void turkishDates() {
  LatinDateParser parser = new LatinDateParser();
  assertThat(parser.parse("3.12.2018"), equalTo(new LocalDate(2018, 12, 3)));
  assertThat(parser.parse("3.ocak.2018"), equalTo(new LocalDate(2018, 1, 3)));
  assertThat(parser.parse("15.mayıs.2018"), equalTo(new LocalDate(2018, 5, 15)));
}

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

@Test
public void minDate() {
  LocalDate afterMinDate = new LocalDate(2017,01,01);
  assertTrue("Should be _after_ minimum date", afterMinDate.after(LocalDate.MIN_DATE));
  LocalDate onMinDate = new LocalDate(1000,01,01);
  assertTrue("Should be _on_ minimum date", onMinDate.equals(LocalDate.MIN_DATE));
  LocalDate beforeMinDate = new LocalDate(99,01,01);
  assertTrue("Should be _before_ minimum date", beforeMinDate.before(LocalDate.MIN_DATE));
}

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

private static FormulaNode dateValue(FilterConfig filter) {
  // GXT serializes the date value as unix time value in milliseconds
  long time = Long.parseLong(filter.getValue());
  Date date = new Date(time);
  LocalDate localDate = new LocalDate(date);
  return new FunctionCallNode(DateFunction.INSTANCE,
    new ConstantNode(localDate.getYear()),
    new ConstantNode(localDate.getMonthOfYear()),
    new ConstantNode(localDate.getDayOfMonth()));
}

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

@Test
public void dateComparison() {
  ColumnFilterParser parser = new ColumnFilterParser(asList(A));
  Multimap<Integer, FilterConfig> map = parser.parseFilter(parse("A == DATE(2017, 1, 1)"));
  Matcher<FilterConfig> equality = Matchers.allOf(
    hasProperty("type", equalTo("date")),
    hasProperty("comparison", equalTo("on")),
    hasProperty("value", equalTo("" + new LocalDate(2017, 1, 1).atMidnightInMyTimezone().getTime())));
  assertThat(map.get(0), contains(equality));
}

代码示例来源: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

@Test
  public void integerOverflow() {
    AccountStatus status = new AccountStatus.Builder()
        .setExpirationTime(new LocalDate(2999, 1, 1))
        .build();

    assertTrue(status.getExpirationTime() > 0);
    assertFalse(status.isExpired());
  }
}

相关文章