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


Java Time.SUNDAY属性代码示例

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


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

示例1: timeDay2Day

public static int timeDay2Day(int day) {
    switch (day) {
        case Time.SUNDAY:
            return SU;
        case Time.MONDAY:
            return MO;
        case Time.TUESDAY:
            return TU;
        case Time.WEDNESDAY:
            return WE;
        case Time.THURSDAY:
            return TH;
        case Time.FRIDAY:
            return FR;
        case Time.SATURDAY:
            return SA;
        default:
            throw new RuntimeException("bad day of week: " + day);
    }
}
 
开发者ID:andela-kogunde,项目名称:CheckSmarter,代码行数:20,代码来源:EventRecurrence.java

示例2: day2TimeDay

public static int day2TimeDay(int day) {
    switch (day) {
        case SU:
            return Time.SUNDAY;
        case MO:
            return Time.MONDAY;
        case TU:
            return Time.TUESDAY;
        case WE:
            return Time.WEDNESDAY;
        case TH:
            return Time.THURSDAY;
        case FR:
            return Time.FRIDAY;
        case SA:
            return Time.SATURDAY;
        default:
            throw new RuntimeException("bad day of week: " + day);
    }
}
 
开发者ID:andela-kogunde,项目名称:CheckSmarter,代码行数:20,代码来源:EventRecurrence.java

示例3: convertDayOfWeekFromTimeToCalendar

/**
 * Converts the day of the week from android.text.format.Time to java.util.Calendar
 */
public static int convertDayOfWeekFromTimeToCalendar(int timeDayOfWeek) {
    switch (timeDayOfWeek) {
        case Time.MONDAY:
            return Calendar.MONDAY;
        case Time.TUESDAY:
            return Calendar.TUESDAY;
        case Time.WEDNESDAY:
            return Calendar.WEDNESDAY;
        case Time.THURSDAY:
            return Calendar.THURSDAY;
        case Time.FRIDAY:
            return Calendar.FRIDAY;
        case Time.SATURDAY:
            return Calendar.SATURDAY;
        case Time.SUNDAY:
            return Calendar.SUNDAY;
        default:
            throw new IllegalArgumentException("Argument must be between Time.SUNDAY and " +
                    "Time.SATURDAY");
    }
}
 
开发者ID:andela-kogunde,项目名称:CheckSmarter,代码行数:24,代码来源:RecurrenceUtils.java

示例4: getFirstDayOfWeek

/**
 * Get first day of week as android.text.format.Time constant.
 *
 * @return the first day of week in android.text.format.Time
 */
public static int getFirstDayOfWeek() {
    int startDay = Calendar.getInstance().getFirstDayOfWeek();

    if (startDay == Calendar.SATURDAY) {
        return Time.SATURDAY;
    } else if (startDay == Calendar.MONDAY) {
        return Time.MONDAY;
    } else {
        return Time.SUNDAY;
    }
}
 
开发者ID:teambition,项目名称:TbRepeatPicker,代码行数:16,代码来源:DateUtil.java


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