当前位置: 首页>>代码示例>>Java>>正文


Java Calendar.JANUARY属性代码示例

本文整理汇总了Java中com.ibm.icu.util.Calendar.JANUARY属性的典型用法代码示例。如果您正苦于以下问题:Java Calendar.JANUARY属性的具体用法?Java Calendar.JANUARY怎么用?Java Calendar.JANUARY使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在com.ibm.icu.util.Calendar的用法示例。


在下文中一共展示了Calendar.JANUARY属性的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: visit

@SuppressWarnings("unchecked")
@Override
public void visit(TemporalExpressions.MonthRange expr) {
    int startMonth = expr.getStartMonth();
    int endMonth = expr.getEndMonth();
    Calendar cal = Calendar.getInstance();
    int maxMonth = cal.getActualMaximum(Calendar.MONTH);
    NumberList monthList = new NumberList();
    monthList.add(startMonth + 1);
    while (startMonth != endMonth) {
        startMonth++;
        if (startMonth > maxMonth) {
            startMonth = Calendar.JANUARY;
        }
        monthList.add(startMonth + 1);
    }
    Recur recur = new Recur(Recur.MONTHLY, 0);
    recur.getMonthList().addAll(monthList);
    this.state.addRecur(recur);
}
 
开发者ID:ilscipio,项目名称:scipio-erp,代码行数:20,代码来源:ICalRecurConverter.java

示例2: getOffset

@Override
public int getOffset(int era, int year, int month, int day, int dayOfWeek, int milliseconds) {
    if (month < Calendar.JANUARY || month > Calendar.DECEMBER) {
        throw new IllegalArgumentException("Month is not in the legal range: " +month);
    } else {
        return getOffset(era, year, month, day, dayOfWeek, milliseconds, Grego.monthLength(year, month));
    }
}
 
开发者ID:abhijitvalluri,项目名称:fitnotifications,代码行数:8,代码来源:OlsonTimeZone.java

示例3: getMonthNames

/**
 * Returns a List of month name Strings - suitable for calendar headings.
 *
 * @param locale
 * @return List of month name Strings
 */
public static List<String> getMonthNames(Locale locale) {
    Calendar tempCal = Calendar.getInstance(locale);
    tempCal.set(Calendar.MONTH, Calendar.JANUARY);
    SimpleDateFormat dateFormat = new SimpleDateFormat("MMMM", locale);
    List<String> resultList = new ArrayList<String>();
    for (int i = Calendar.JANUARY; i <= tempCal.getActualMaximum(Calendar.MONTH); i++) {
        resultList.add(dateFormat.format(tempCal.getTime()));
        tempCal.roll(Calendar.MONTH, 1);
    }
    return resultList;
}
 
开发者ID:ilscipio,项目名称:scipio-erp,代码行数:17,代码来源:UtilDateTime.java

示例4: MonthRange

/**
 * @param start An integer in the range of <code>Calendar.JANUARY</code>
 * to <code>Calendar.UNDECIMBER</code>
 * @param end An integer in the range of <code>Calendar.JANUARY</code>
 * to <code>Calendar.UNDECIMBER</code>
 */
public MonthRange(int start, int end) {
    if (start < Calendar.JANUARY || start > Calendar.UNDECIMBER) {
        throw new IllegalArgumentException("Invalid start argument");
    }
    if (end < Calendar.JANUARY || end > Calendar.UNDECIMBER) {
        throw new IllegalArgumentException("Invalid end argument");
    }
    this.sequence = SEQUENCE_MONTH_RANGE + start;
    this.start = start;
    this.end = end;
    if (Debug.verboseOn()) {
        Debug.logVerbose("Created " + this, module);
    }
}
 
开发者ID:ilscipio,项目名称:scipio-erp,代码行数:20,代码来源:TemporalExpressions.java

示例5: getMonthValueList

/** Returns a List of Maps containing month values.
 * @param locale
 * @return List of Maps. Each Map has a
 * <code>description</code> entry and a <code>value</code> entry.
 */
public static List<Map<String, Object>> getMonthValueList(Locale locale) {
    Calendar tempCal = Calendar.getInstance(locale);
    tempCal.set(Calendar.MONTH, Calendar.JANUARY);
    SimpleDateFormat dateFormat = new SimpleDateFormat("MMMM", locale);
    List<Map<String, Object>> result = new ArrayList<Map<String, Object>>(13);
    for (int i = Calendar.JANUARY; i <= tempCal.getActualMaximum(Calendar.MONTH); i++) {
        result.add(UtilMisc.toMap("description", (Object)dateFormat.format(tempCal.getTime()), "value", i));
        tempCal.roll(Calendar.MONTH, 1);
    }
    return result;
}
 
开发者ID:ilscipio,项目名称:scipio-erp,代码行数:16,代码来源:ExpressionUiHelper.java


注:本文中的com.ibm.icu.util.Calendar.JANUARY属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。