本文整理汇总了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);
}
示例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());
}
示例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;
}
示例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();
}
示例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();
}
示例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;
}
示例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);
}
示例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;
}