本文整理了Java中org.activityinfo.model.type.time.LocalDate.toString()
方法的一些代码示例,展示了LocalDate.toString()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。LocalDate.toString()
方法的具体详情如下:
包路径:org.activityinfo.model.type.time.LocalDate
类名称:LocalDate
方法名:toString
[英]Returns this data as an ISO-8601 string
[中]以ISO-8601字符串的形式返回此数据
代码示例来源:origin: bedatadriven/activityinfo
@Override
public Object toHrdProperty(LocalDate value) {
// Use simple YYYY-MM-DD
return value.toString();
}
代码示例来源:origin: bedatadriven/activityinfo
/**
* Returns this data as an ISO-8601 string
*/
@Override
public String toString() {
return toString(year, monthOfYear, dayOfMonth);
}
代码示例来源:origin: bedatadriven/activityinfo
public Tab get(LocalDate day) {
return new Tab(day.toString(), day.toString(), SubFormKind.DAILY);
}
代码示例来源:origin: bedatadriven/activityinfo
@Override
public JsonValue toJson() {
return Json.create(toString());
}
代码示例来源:origin: bedatadriven/activityinfo
@Override
public JsonValue toJson() {
JsonValue object = createObject();
object.put("start", startDate.toString());
object.put("end", endDate.toString());
return object;
}
代码示例来源:origin: bedatadriven/activityinfo
@Override
public ColumnView columnApply(int numRows, List<ColumnView> arguments) {
return new ConstantColumnView(numRows, new LocalDate(new Date()).toString());
}
}
代码示例来源:origin: bedatadriven/activityinfo
@Override
public void setValue(Cell cell, int row) {
// Excel does not support date values prior to 1900,
// so we have no choice but to render the value as text if the date occurs
// prior to 1900.
LocalDate localDate = renderer.render(row);
if(localDate.getYear() < 1900) {
cell.setCellValue(localDate.toString());
} else {
cell.setCellValue(localDate.atMidnightInMyTimezone());
}
}
}
代码示例来源:origin: bedatadriven/activityinfo
@Override
public ColumnView columnApply(int numRows, List<ColumnView> arguments) {
ColumnView year = arguments.get(0);
ColumnView month = arguments.get(1);
ColumnView day = arguments.get(2);
String[] dates = new String[numRows];
for (int i = 0; i < numRows; i++) {
dates[i] = apply(
year.getDouble(i),
month.getDouble(i),
day.getDouble(i)).toString();
}
return new StringArrayColumnView(dates);
}
代码示例来源:origin: bedatadriven/activityinfo
@Override
public String apply(int value) {
return LocalDate.toString(
DateEncoding.getYear(value),
DateEncoding.getLocalDateMonth(value),
DateEncoding.getLocalDateDay(value));
}
}
代码示例来源:origin: bedatadriven/activityinfo
@Override
public void renderTo(FieldValue fieldValue, SafeHtmlBuilder html) {
LocalDate localDate = (LocalDate) fieldValue;
html.appendHtmlConstant("<p>");
html.appendEscaped(localDate.toString());
html.appendHtmlConstant("</p>");
}
}
代码示例来源: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
private String renderValue(FormField field, FieldValue value) {
if(value == null) {
return "";
}
if(value instanceof HasStringValue) {
return ((HasStringValue) value).asString();
}
if(field.getType() instanceof EnumType) {
return render((EnumType)field.getType(), (EnumValue)value);
}
if(field.getType() instanceof QuantityType) {
Quantity quantity = (Quantity) value;
return Double.toString(quantity.getValue());
}
if(field.getType() instanceof LocalDateType) {
return ((LocalDate) value).toString();
}
if(field.getType() instanceof ReferenceType) {
return renderRef((ReferenceType)field.getType(), (ReferenceValue)value);
}
return "";
}
代码示例来源:origin: bedatadriven/activityinfo
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()));
代码示例来源:origin: bedatadriven/activityinfo
trialEndDate = new LocalDate(2050,1,1);
db.setAccountEndDate(trialEndDate.toString());
db.setSuspended(trialEndDate.before(today));
} else {
db.setBillingAccountName(row.get("baName"));
db.setAccountEndDate(new LocalDate(row.getDate("baEndDate")).toString());
内容来源于网络,如有侵权,请联系作者删除!