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


Java GregorianCalendar.FRIDAY屬性代碼示例

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


在下文中一共展示了GregorianCalendar.FRIDAY屬性的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getWeekdayNum

private static int getWeekdayNum(Weekday weekday) {
	switch (weekday) {
		case SUNDAY:
			return GregorianCalendar.SUNDAY;
		case MONDAY:
			return GregorianCalendar.MONDAY;
		case TUESDAY:
			return GregorianCalendar.TUESDAY;
		case WEDNESDAY:
			return GregorianCalendar.WEDNESDAY;
		case THURSDAY:
			return GregorianCalendar.THURSDAY;
		case FRIDAY:
			return GregorianCalendar.FRIDAY;
		case SATURDAY:
			return GregorianCalendar.SATURDAY;
		default:
			throw new IllegalArgumentException(L10nUtil.getMessage(MessageCodes.UNSUPPORTED_WEEKDAY, DefaultMessages.UNSUPPORTED_WEEKDAY, weekday));
	}
}
 
開發者ID:phoenixctms,項目名稱:ctsms,代碼行數:20,代碼來源:DateCalc.java

示例2: getNameWeekDay

private String getNameWeekDay(Date date) {
    final GregorianCalendar gc = new GregorianCalendar();
    gc.setTime(date);
    String s = "none";
    //Monday Tuesday WEDNESDAY Thursday Friday Saturday Sunday
    //понедельник вторник среда четверг пятница суббота воскресенье
    switch (gc.get(GregorianCalendar.DAY_OF_WEEK)) {
        case GregorianCalendar.MONDAY:
            s = getLocaleMessage("calendar.day.monday");
            break;
        case GregorianCalendar.TUESDAY:
            s = getLocaleMessage("calendar.day.tuesday");
            break;
        case GregorianCalendar.WEDNESDAY:
            s = getLocaleMessage("calendar.day.wednesday");
            break;
        case GregorianCalendar.THURSDAY:
            s = getLocaleMessage("calendar.day.thursday");
            break;
        case GregorianCalendar.FRIDAY:
            s = getLocaleMessage("calendar.day.friday");
            break;
        case GregorianCalendar.SATURDAY:
            s = getLocaleMessage("calendar.day.saturday");
            break;
        case GregorianCalendar.SUNDAY:
            s = getLocaleMessage("calendar.day.sunday");
            break;
    }
    return s;
}
 
開發者ID:bcgov,項目名稱:sbc-qsystem,代碼行數:31,代碼來源:FAdvanceCalendar.java

示例3: getCalendarWeek

public static CalendarWeekVO getCalendarWeek(Date date) {
	GregorianCalendar cal = new GregorianCalendar();
	cal.setTime(date);
	int year = cal.get(GregorianCalendar.YEAR);
	int period;
	switch ((new GregorianCalendar(year, 0, 1)).get(GregorianCalendar.DAY_OF_WEEK)) {
		case GregorianCalendar.SUNDAY:
			period = -1;
			break;
		case GregorianCalendar.MONDAY:
			period = 0;
			break;
		case GregorianCalendar.TUESDAY:
			period = 1;
			break;
		case GregorianCalendar.WEDNESDAY:
			period = 2;
			break;
		case GregorianCalendar.THURSDAY:
			period = 3;
			break;
		case GregorianCalendar.FRIDAY:
			period = -3;
			break;
		case GregorianCalendar.SATURDAY:
			period = -2;
			break;
		default:
			period = 0;
	}
	int week = (int) ((cal.get(GregorianCalendar.DAY_OF_YEAR) - 1 + period) / 7d + 1);
	if (week > getWeeksOfYear(year)) {
		return new CalendarWeekVO(cal.getTime(), 1, year + 1);
	} else if (week == 0) {
		return new CalendarWeekVO(cal.getTime(), getWeeksOfYear(year - 1), year - 1);
	} else {
		return new CalendarWeekVO(cal.getTime(), week, year);
	}
}
 
開發者ID:phoenixctms,項目名稱:ctsms,代碼行數:39,代碼來源:DateCalc.java


注:本文中的java.util.GregorianCalendar.FRIDAY屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。