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


Java DtStart.getDate方法代码示例

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


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

示例1: isEventValid

import net.fortuna.ical4j.model.property.DtStart; //导入方法依赖的package包/类
private static boolean isEventValid(VEvent event, ValidationConfig config){
    
    DtStart startDate = event.getStartDate();
    DtEnd endDate = event.getEndDate(true);
    if(startDate == null || 
        startDate.getDate() == null ||
        endDate != null && startDate.getDate().after(endDate.getDate())){
        
        return false;
    }
    
    
    for(PropertyValidator validator : values()){
        if(!validator.isValid(event, config)){
            return false; 
        }
    }
    
    return areTimeZoneIdsValid(event);
}
 
开发者ID:1and1,项目名称:cosmo,代码行数:21,代码来源:EventValidator.java

示例2: fromDtStart

import net.fortuna.ical4j.model.property.DtStart; //导入方法依赖的package包/类
protected static Timestamp fromDtStart(PropertyList propertyList) {
    DtStart iCalObj = (DtStart) propertyList.getProperty(DtStart.DTSTART);
    if (iCalObj == null) {
        return null;
    }
    Date date = iCalObj.getDate();
    return new Timestamp(date.getTime());
}
 
开发者ID:ilscipio,项目名称:scipio-erp,代码行数:9,代码来源:ICalConverter.java

示例3: getStartDate

import net.fortuna.ical4j.model.property.DtStart; //导入方法依赖的package包/类
/**
 * Gets start date.
 * @param comp The component.
 * @return The date.
 */
private Date getStartDate(Component comp) {
    final DtStart dtStart = ICalendarUtils.getStartDate(comp);
    if(dtStart != null) {
        return dtStart.getDate();
    }
    return null;
}
 
开发者ID:ksokol,项目名称:carldav,代码行数:13,代码来源:RecurrenceExpander.java

示例4: getStartDate

import net.fortuna.ical4j.model.property.DtStart; //导入方法依赖的package包/类
public Date getStartDate() {
    VEvent event = getEvent();
    if(event==null) {
        return null;
    }
    
    DtStart dtStart = event.getStartDate();
    if (dtStart == null) {
        return null;
    }
    return dtStart.getDate();
}
 
开发者ID:1and1,项目名称:cosmo,代码行数:13,代码来源:HibBaseEventStamp.java

示例5: getStartDate

import net.fortuna.ical4j.model.property.DtStart; //导入方法依赖的package包/类
/**
 * Gets start date.
 * @return date.
 */
public Date getStartDate() {
    VEvent event = getEvent();
    if (event==null) {
        return null;
    }
    
    DtStart dtStart = event.getStartDate();
    if (dtStart == null) {
        return null;
    }
    return dtStart.getDate();
}
 
开发者ID:1and1,项目名称:cosmo,代码行数:17,代码来源:MockBaseEventStamp.java

示例6: getStartDate

import net.fortuna.ical4j.model.property.DtStart; //导入方法依赖的package包/类
/**
 * Gets start date.
 * @param comp The component.
 * @return The date.
 */
private Date getStartDate(Component comp) {
    DtStart prop = (DtStart) comp.getProperties().getProperty(
            Property.DTSTART);
    return (prop != null) ? prop.getDate() : null;
}
 
开发者ID:1and1,项目名称:cosmo,代码行数:11,代码来源:RecurrenceExpander.java

示例7: convertedCalendarMatchesStartTime

import net.fortuna.ical4j.model.property.DtStart; //导入方法依赖的package包/类
@Test
public void convertedCalendarMatchesStartTime() throws DatatypeConfigurationException{
	CalendarItemType calendarItem = new CalendarItemType();		
	Date dateStartIn = new Date();
	XMLGregorianCalendar xmlStartIn = DateHelp.convertDateToXMLGregorianCalendar(dateStartIn);
	calendarItem.setStart(xmlStartIn);
	
	Duration duration = DatatypeFactory.newInstance().newDuration(1000 * 60 * 60);
	XMLGregorianCalendar end = calendarItem.getStart();
	end.add(duration);
	calendarItem.setEnd(end);
	
	log.info("created calendar item with start="+calendarItem.getStart());
	
	Calendar calendar = eventConverter.convertToCalendar(Collections.singleton(calendarItem), null);
	
	//calendar should not be null
	assertNotNull(calendar);
	ComponentList components = calendar.getComponents();
	//calendar should have components
	assertNotNull(components);
	
	//calendar should have exactly one component
	assertEquals(1, components.size());
	
	//components should be events
	assertEquals(components, calendar.getComponents(VEvent.VEVENT));
	
	Object object = components.get(0);
	assertNotNull(object);
	assertTrue(object instanceof VEvent);
	
	VEvent event =(VEvent) object;
	assertNotNull(event);
	
	DtStart dtStart = event.getStartDate();
	assertNotNull(dtStart);
	net.fortuna.ical4j.model.Date dateStartOut = dtStart.getDate();
	assertNotNull(dateStartOut);
	XMLGregorianCalendar xmlStartOut = DateHelp.convertDateToXMLGregorianCalendar(dateStartOut);
	
	log.info("dateStartIn="+dateStartIn);
	log.info("xmlStartIn="+xmlStartIn);
	log.info("dateStartOut="+dateStartOut);
	log.info("xmlStartOut+="+xmlStartOut);
	
	assertEquals(dateStartIn, new Date(dateStartIn.getTime()));
	assertEquals(xmlStartIn, xmlStartOut);
}
 
开发者ID:Bedework,项目名称:exchange-ws-client,代码行数:50,代码来源:ExchangeEventConverterImplTest.java

示例8: getStartDate

import net.fortuna.ical4j.model.property.DtStart; //导入方法依赖的package包/类
/**
 * Gets start date.
 *
 * @param comp The component.
 * @return The date.
 */
private Date getStartDate(Component comp) {
    DtStart prop = (DtStart) comp.getProperties().getProperty(
            Property.DTSTART);
    return (prop != null) ? prop.getDate() : null;
}
 
开发者ID:ksokol,项目名称:carldav,代码行数:12,代码来源:InstanceList.java


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