当前位置: 首页>>代码示例>>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;未经允许,请勿转载。