本文整理汇总了Java中org.joda.time.base.AbstractPartial类的典型用法代码示例。如果您正苦于以下问题:Java AbstractPartial类的具体用法?Java AbstractPartial怎么用?Java AbstractPartial使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
AbstractPartial类属于org.joda.time.base包,在下文中一共展示了AbstractPartial类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: rollForwardWith
import org.joda.time.base.AbstractPartial; //导入依赖的package包/类
public static DateTime rollForwardWith(ReadableInstant now, AbstractPartial lp) {
DateTime dt = lp.toDateTime(now);
while (dt.isBefore(now)) {
dt = dt.withFieldAdded(lp.getFieldTypes()[0].getRangeDurationType(), 1);
}
return dt;
}
开发者ID:codeforgreenville,项目名称:trolley-tracker-android-client,代码行数:8,代码来源:Utils.java
示例2: format
import org.joda.time.base.AbstractPartial; //导入依赖的package包/类
@Override
public String format(final AbstractPartial target, String pattern) {
try {
return DateTimeFormat.forPattern(pattern).withLocale(locale).print(target);
} catch (final Exception e) {
throw new TemplateProcessingException(
"Error formatting Joda LocalTime with pattern '" + pattern + "' for locale " + this.locale, e);
}
}
开发者ID:eveoh,项目名称:thymeleaf-joda,代码行数:10,代码来源:JodaImpl.java
示例3: convertPartialToCalendar
import org.joda.time.base.AbstractPartial; //导入依赖的package包/类
private Calendar convertPartialToCalendar(AbstractPartial partial) {
Calendar calendar = Calendar.getInstance();
calendar.clear();
DateTimeFieldType[] fieldTypes = partial.getFieldTypes();
for (DateTimeFieldType fieldType : fieldTypes) {
if (fieldType.equals(DateTimeFieldType.dayOfMonth())) {
calendar.set(Calendar.DAY_OF_MONTH, partial.get(DateTimeFieldType.dayOfMonth()));
continue;
}
if (fieldType.equals(DateTimeFieldType.monthOfYear())) {
calendar.set(Calendar.MONTH, partial.get(DateTimeFieldType.monthOfYear()) - 1);
continue;
}
if (fieldType.equals(DateTimeFieldType.year())) {
calendar.set(Calendar.YEAR, partial.get(DateTimeFieldType.year()));
continue;
}
if (fieldType.equals(DateTimeFieldType.hourOfDay())) {
calendar.set(Calendar.HOUR_OF_DAY, partial.get(DateTimeFieldType.hourOfDay()));
continue;
}
if (fieldType.equals(DateTimeFieldType.minuteOfHour())) {
calendar.set(Calendar.MINUTE, partial.get(DateTimeFieldType.minuteOfHour()));
continue;
}
if (fieldType.equals(DateTimeFieldType.secondOfMinute())) {
calendar.set(Calendar.SECOND, partial.get(DateTimeFieldType.secondOfMinute()));
continue;
}
}
return calendar;
}
开发者ID:FenixEdu,项目名称:bennu-renderers,代码行数:40,代码来源:PartialRenderer.java
示例4: convertPartialToDate
import org.joda.time.base.AbstractPartial; //导入依赖的package包/类
private Date convertPartialToDate(AbstractPartial partial) {
if (partial == null) {
return null;
}
Calendar calendar = Calendar.getInstance();
calendar.clear();
if (isHour()) {
calendar.set(Calendar.HOUR_OF_DAY, partial.get(DateTimeFieldType.hourOfDay()));
}
if (isMinute()) {
calendar.set(Calendar.MINUTE, partial.get(DateTimeFieldType.minuteOfHour()));
}
return calendar.getTime();
}
开发者ID:FenixEdu,项目名称:bennu-renderers,代码行数:15,代码来源:MultipleFormatTimeInputRenderer.java
示例5: convertPartialToDate
import org.joda.time.base.AbstractPartial; //导入依赖的package包/类
private Date convertPartialToDate(AbstractPartial partial) {
if (partial == null) {
return null;
}
Calendar calendar = Calendar.getInstance();
calendar.clear();
if (isDay()) {
calendar.set(Calendar.DAY_OF_MONTH, partial.get(DateTimeFieldType.dayOfMonth()));
}
if (isMonth()) {
calendar.set(Calendar.MONTH, partial.get(DateTimeFieldType.monthOfYear()) - 1);
}
if (isYear()) {
calendar.set(Calendar.YEAR, partial.get(DateTimeFieldType.year()));
}
if (isHour()) {
calendar.set(Calendar.HOUR_OF_DAY, partial.get(DateTimeFieldType.hourOfDay()));
}
if (isMinute()) {
calendar.set(Calendar.MINUTE, partial.get(DateTimeFieldType.minuteOfHour()));
}
if (isSecond()) {
calendar.set(Calendar.SECOND, partial.get(DateTimeFieldType.secondOfMinute()));
}
return calendar.getTime();
}
开发者ID:FenixEdu,项目名称:bennu-renderers,代码行数:35,代码来源:PartialInputRenderer.java
示例6: before
import org.joda.time.base.AbstractPartial; //导入依赖的package包/类
@Override
public boolean before(final AbstractPartial date1, final AbstractPartial date2) {
return date1.isBefore(date2);
}
开发者ID:eveoh,项目名称:thymeleaf-joda,代码行数:5,代码来源:JodaImpl.java
示例7: after
import org.joda.time.base.AbstractPartial; //导入依赖的package包/类
@Override
public boolean after(final AbstractPartial date1, final AbstractPartial date2) {
return date1.isAfter(date2);
}
开发者ID:eveoh,项目名称:thymeleaf-joda,代码行数:5,代码来源:JodaImpl.java
示例8: equals
import org.joda.time.base.AbstractPartial; //导入依赖的package包/类
@Override
public boolean equals(final AbstractPartial date1, final AbstractPartial date2) {
return date1.equals(date2);
}
开发者ID:eveoh,项目名称:thymeleaf-joda,代码行数:5,代码来源:JodaImpl.java
示例9: createTextField
import org.joda.time.base.AbstractPartial; //导入依赖的package包/类
@Override
protected HtmlComponent createTextField(Object object, Class type) {
Date date = convertPartialToDate((AbstractPartial) object);
return super.createTextField(date, type);
}
开发者ID:FenixEdu,项目名称:bennu-renderers,代码行数:6,代码来源:MultipleFormatTimeInputRenderer.java
示例10: createTextField
import org.joda.time.base.AbstractPartial; //导入依赖的package包/类
@Override
protected HtmlComponent createTextField(Object object, Class type) {
Date date = convertPartialToDate((AbstractPartial) object);
return super.createTextField(date, type);
}
开发者ID:FenixEdu,项目名称:bennu-renderers,代码行数:7,代码来源:PartialInputRenderer.java
示例11: format
import org.joda.time.base.AbstractPartial; //导入依赖的package包/类
/**
* Usage: #joda.format(target, pattern)
*
* @param target Joda {@link org.joda.time.LocalDate} or {@link org.joda.time.LocalTime}
* @param pattern Valid {@link org.joda.time.format.DateTimeFormatter} pattern
* @return Formatted string
*/
String format(AbstractPartial target, String pattern);
开发者ID:eveoh,项目名称:thymeleaf-joda,代码行数:9,代码来源:Joda.java
示例12: before
import org.joda.time.base.AbstractPartial; //导入依赖的package包/类
/**
* Usage: #joda.before(date1, date2)
*
* @see org.joda.time.base.AbstractPartial#isBefore(org.joda.time.ReadablePartial)
*/
boolean before(AbstractPartial date1, AbstractPartial date2);
开发者ID:eveoh,项目名称:thymeleaf-joda,代码行数:7,代码来源:Joda.java
示例13: after
import org.joda.time.base.AbstractPartial; //导入依赖的package包/类
/**
* Usage: #joda.after(date1, date2)
*
* @see org.joda.time.base.AbstractPartial#isAfter(org.joda.time.ReadablePartial)
*/
boolean after(AbstractPartial date1, AbstractPartial date2);
开发者ID:eveoh,项目名称:thymeleaf-joda,代码行数:7,代码来源:Joda.java
示例14: equals
import org.joda.time.base.AbstractPartial; //导入依赖的package包/类
/**
* Usage: #joda.equals(date1, date2)
*
* @see org.joda.time.base.AbstractPartial#equals(java.lang.Object)
*/
boolean equals(AbstractPartial date1, AbstractPartial date2);
开发者ID:eveoh,项目名称:thymeleaf-joda,代码行数:7,代码来源:Joda.java
注:本文中的org.joda.time.base.AbstractPartial类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论