本文整理汇总了Java中com.ibm.icu.util.Calendar.DATE属性的典型用法代码示例。如果您正苦于以下问题:Java Calendar.DATE属性的具体用法?Java Calendar.DATE怎么用?Java Calendar.DATE使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类com.ibm.icu.util.Calendar
的用法示例。
在下文中一共展示了Calendar.DATE属性的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getPatterns
/**
* @internal
* @deprecated This API is ICU internal only.
*/
@Deprecated
public String getPatterns(Calendar fromCalendar,
Calendar toCalendar,
Output<String> part2) {
// First, find the largest different calendar field.
int field;
if ( fromCalendar.get(Calendar.ERA) != toCalendar.get(Calendar.ERA) ) {
field = Calendar.ERA;
} else if ( fromCalendar.get(Calendar.YEAR) !=
toCalendar.get(Calendar.YEAR) ) {
field = Calendar.YEAR;
} else if ( fromCalendar.get(Calendar.MONTH) !=
toCalendar.get(Calendar.MONTH) ) {
field = Calendar.MONTH;
} else if ( fromCalendar.get(Calendar.DATE) !=
toCalendar.get(Calendar.DATE) ) {
field = Calendar.DATE;
} else if ( fromCalendar.get(Calendar.AM_PM) !=
toCalendar.get(Calendar.AM_PM) ) {
field = Calendar.AM_PM;
} else if ( fromCalendar.get(Calendar.HOUR) !=
toCalendar.get(Calendar.HOUR) ) {
field = Calendar.HOUR;
} else if ( fromCalendar.get(Calendar.MINUTE) !=
toCalendar.get(Calendar.MINUTE) ) {
field = Calendar.MINUTE;
} else if ( fromCalendar.get(Calendar.SECOND) !=
toCalendar.get(Calendar.SECOND) ) {
field = Calendar.SECOND;
} else {
return null;
}
PatternInfo intervalPattern = fIntervalPatterns.get(
DateIntervalInfo.CALENDAR_FIELD_TO_PATTERN_LETTER[field]);
part2.value = intervalPattern.getSecondPart();
return intervalPattern.getFirstPart();
}