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


Java WeekDayList类代码示例

本文整理汇总了Java中net.fortuna.ical4j.model.WeekDayList的典型用法代码示例。如果您正苦于以下问题:Java WeekDayList类的具体用法?Java WeekDayList怎么用?Java WeekDayList使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: getFrequency

import net.fortuna.ical4j.model.WeekDayList; //导入依赖的package包/类
public String getFrequency() {
		if (recur == null) {
			return null;
		}

		String extendedFrequency = recur.getFrequency();
		WeekDayList dayList = recur.getDayList();
		String dayListAsString = dayList.toString();
		
		if (! dayList.isEmpty()) {
			if ("MO,WE,FR".equals(dayListAsString)) {
				extendedFrequency = new MWFRecurrenceRule().getFrequency();
			}
			if ("TU,TH".equals(dayListAsString)) {
				extendedFrequency = new TThRecurrenceRule().getFrequency();
			}
//			if ("MO,TU,WE,TH,FR".equals(dayListAsString)) {
//				extendedFrequency = new TThRecurrenceRule().getFrequency();
//			}
		}
		
		String sakaiFrequency = frequencyLookup.get(extendedFrequency);

		return sakaiFrequency;
	}
 
开发者ID:sakaiproject,项目名称:sakai,代码行数:26,代码来源:ICalRecurrence.java

示例2: getRecurrence

import net.fortuna.ical4j.model.WeekDayList; //导入依赖的package包/类
public static String getRecurrence(final String rule) {
    if (rule != null) {
        try {
            final Recur recur = new Recur(rule);
            final String frequency = recur.getFrequency();
            final WeekDayList wdl = recur.getDayList();
            final Integer interval = recur.getInterval();
            if ((wdl != null && wdl.size() > 0)) {
                // we only support one rule with daylist
                return CalendarEntry.WORKDAILY;
            } else if (interval != null && interval == 2) {
                // we only support one rule with interval
                return CalendarEntry.BIWEEKLY;
            } else {
                // native supportet rule
                return frequency;
            }
        } catch (final ParseException e) {
            log.error("cannot restore recurrence rule", e);
        }
    }

    return null;
}
 
开发者ID:huihoo,项目名称:olat,代码行数:25,代码来源:CalendarUtils.java


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