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


Java Dur.getHours方法代码示例

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


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

示例1: fromDuration

import net.fortuna.ical4j.model.Dur; //导入方法依赖的package包/类
protected static Double fromDuration(PropertyList propertyList) {
    Duration iCalObj = (Duration) propertyList.getProperty(Duration.DURATION);
    if (iCalObj == null) {
        return null;
    }
    Dur dur = iCalObj.getDuration();
    TimeDuration td = new TimeDuration(0, 0, (dur.getWeeks() * 7) + dur.getDays(), dur.getHours(), dur.getMinutes(), dur.getSeconds(), 0);
    return new Double(TimeDuration.toLong(td));
}
 
开发者ID:ilscipio,项目名称:scipio-erp,代码行数:10,代码来源:ICalConverter.java

示例2: createTeamEventDO

import net.fortuna.ical4j.model.Dur; //导入方法依赖的package包/类
public static TeamEventDO createTeamEventDO(final VEvent event)
{
  final TeamEventDO teamEvent = new TeamEventDO();
  final DtStart dtStart = event.getStartDate();
  final String value = dtStart.toString();
  if (value.indexOf("VALUE=DATE") >= 0) {
    teamEvent.setAllDay(true);
  }
  Timestamp timestamp = ICal4JUtils.getSqlTimestamp(dtStart.getDate());
  teamEvent.setStartDate(timestamp);
  if (teamEvent.isAllDay() == true) {
    final org.joda.time.DateTime jodaTime = new org.joda.time.DateTime(event.getEndDate().getDate());
    final net.fortuna.ical4j.model.Date fortunaEndDate = new net.fortuna.ical4j.model.Date(jodaTime.plusDays(-1).toDate());
    timestamp = new Timestamp(fortunaEndDate.getTime());
  } else {
    timestamp = ICal4JUtils.getSqlTimestamp(event.getEndDate().getDate());
  }
  teamEvent.setEndDate(timestamp);
  if (event.getUid() != null) {
    teamEvent.setExternalUid(event.getUid().getValue());
  }
  if (event.getLocation() != null) {
    teamEvent.setLocation(event.getLocation().getValue());
  }
  if (event.getDescription() != null) {
    teamEvent.setNote(event.getDescription().getValue());
  }
  if (event.getSummary() != null) {
    teamEvent.setSubject(event.getSummary().getValue());
  } else {
    teamEvent.setSubject("");
  }
  if (event.getOrganizer() != null) {
    teamEvent.setOrganizer(event.getOrganizer().getValue());
  }
  @SuppressWarnings("unchecked")
  final List<VAlarm> alarms = event.getAlarms();
  if (alarms != null && alarms.size() >= 1) {
    final Dur dur = alarms.get(0).getTrigger().getDuration();
    if (dur != null) { // Might be null.
      // consider weeks
      int weeksToDays = 0;
      if (dur.getWeeks() != 0) {
        weeksToDays = dur.getWeeks() * DURATION_OF_WEEK;
      }
      if (dur.getDays() != 0) {
        teamEvent.setReminderDuration(dur.getDays() + weeksToDays);
        teamEvent.setReminderDurationUnit(ReminderDurationUnit.DAYS);
      } else if (dur.getHours() != 0) {
        teamEvent.setReminderDuration(dur.getHours());
        teamEvent.setReminderDurationUnit(ReminderDurationUnit.HOURS);
      } else if (dur.getMinutes() != 0) {
        teamEvent.setReminderDuration(dur.getMinutes());
        teamEvent.setReminderDurationUnit(ReminderDurationUnit.MINUTES);
      }
    }
  }
  final RRule rule = (RRule) event.getProperty(Property.RRULE);
  if (rule != null) {
    teamEvent.setRecurrenceRule(rule.getValue());
  }
  final ExDate exDate = (ExDate) event.getProperty(Property.EXDATE);
  if (exDate != null) {
    teamEvent.setRecurrenceExDate(exDate.getValue());
  }
  return teamEvent;
}
 
开发者ID:micromata,项目名称:projectforge-webapp,代码行数:68,代码来源:TeamEventUtils.java


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