當前位置: 首頁>>代碼示例>>Java>>正文


Java Time.SATURDAY屬性代碼示例

本文整理匯總了Java中android.text.format.Time.SATURDAY屬性的典型用法代碼示例。如果您正苦於以下問題:Java Time.SATURDAY屬性的具體用法?Java Time.SATURDAY怎麽用?Java Time.SATURDAY使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在android.text.format.Time的用法示例。


在下文中一共展示了Time.SATURDAY屬性的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.SATURDAY屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。