本文整理汇总了Java中net.fortuna.ical4j.model.property.DateProperty类的典型用法代码示例。如果您正苦于以下问题:Java DateProperty类的具体用法?Java DateProperty怎么用?Java DateProperty使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DateProperty类属于net.fortuna.ical4j.model.property包,在下文中一共展示了DateProperty类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setDatePropertyValue
import net.fortuna.ical4j.model.property.DateProperty; //导入依赖的package包/类
protected void setDatePropertyValue(DateProperty prop,
Date date) {
if (prop == null) {
return;
}
Value value = (Value)
prop.getParameters().getParameter(Parameter.VALUE);
if (value != null) {
prop.getParameters().remove(value);
}
// Add VALUE=DATE for Date values, otherwise
// leave out VALUE=DATE-TIME because it is redundant
if(! (date instanceof DateTime)) {
prop.getParameters().add(Value.DATE);
}
}
示例2: setDatePropertyValue
import net.fortuna.ical4j.model.property.DateProperty; //导入依赖的package包/类
/**
* Sets date property value
* @param prop The date property.
* @param date The date.
*/
protected void setDatePropertyValue(DateProperty prop, Date date) {
if (prop == null) {
return;
}
Value value = (Value) prop.getParameters()
.getParameter(Parameter.VALUE);
if (value != null) {
prop.getParameters().remove(value);
}
// Add VALUE=DATE for Date values, otherwise
// leave out VALUE=DATE-TIME because it is redundant
if (!(date instanceof DateTime)) {
prop.getParameters().add(Value.DATE);
}
}
示例3: evaluate
import net.fortuna.ical4j.model.property.DateProperty; //导入依赖的package包/类
/**
* Evaluates property.
* @param property The proeprty.
* @param filter The time range filter.
* @return The result.
*/
private boolean evaluate(Property property, TimeRangeFilter filter) {
if(!(property instanceof DateProperty) ) {
return false;
}
DateProperty dateProp = (DateProperty) property;
Date date = dateProp.getDate();
return date.before(filter.getPeriod().getEnd()) &&
date.after(filter.getPeriod().getStart()) ||
date.equals(filter.getPeriod().getStart()) ;
}
示例4: componentToUTC
import net.fortuna.ical4j.model.property.DateProperty; //导入依赖的package包/类
/**
* @param comp The component.
*/
private void componentToUTC(Component comp) {
// Do to each top-level property
for (Property prop : (List<Property>) comp.getProperties()) {
if (prop instanceof DateProperty) {
DateProperty dprop = (DateProperty) prop;
Date date = dprop.getDate();
if (date instanceof DateTime &&
(((DateTime) date).getTimeZone() != null)) {
dprop.setUtc(true);
}
}
}
// Do to each embedded component
ComponentList subcomps = null;
if (comp instanceof VEvent) {
subcomps = ((VEvent)comp).getAlarms();
}
else if (comp instanceof VToDo) {
subcomps = ((VToDo)comp).getAlarms();
}
if (subcomps != null) {
for (Component subcomp : (List<Component>) subcomps) {
componentToUTC(subcomp);
}
}
}
示例5: componentToUTC
import net.fortuna.ical4j.model.property.DateProperty; //导入依赖的package包/类
/**
* @param comp The component.
*/
private void componentToUTC(Component comp) {
// Do to each top-level property
for (Property prop : (List<Property>) comp.getProperties()) {
if (prop instanceof DateProperty) {
DateProperty dprop = (DateProperty) prop;
Date date = dprop.getDate();
if (date instanceof DateTime &&
(((DateTime) date).getTimeZone() != null)) {
dprop.setUtc(true);
}
}
}
// Do to each embedded component
ComponentList<? extends CalendarComponent> subcomps = null;
if (comp instanceof VEvent) {
subcomps = ((VEvent) comp).getAlarms() ;
}
else if (comp instanceof VToDo) {
subcomps = ((VToDo)comp).getAlarms();
}
if (subcomps != null) {
for (CalendarComponent subcomp : subcomps) {
componentToUTC(subcomp);
}
}
}
示例6: fixDateTimeProperties
import net.fortuna.ical4j.model.property.DateProperty; //导入依赖的package包/类
private void fixDateTimeProperties(Component component) {
PropertyList<Property> props = component.getProperties();
for(Property prop : props) {
if(prop instanceof DateProperty || prop instanceof DateListProperty) {
Value v = (Value) prop.getParameter(Parameter.VALUE);
if(Value.DATE_TIME.equals(v)) {
prop.getParameters().remove(v);
}
}
}
}
示例7: toDate
import net.fortuna.ical4j.model.property.DateProperty; //导入依赖的package包/类
@Converter
public static Date toDate(DateProperty property) {
return property.getDate();
}
示例8: JsonDatePropertyAdapter
import net.fortuna.ical4j.model.property.DateProperty; //导入依赖的package包/类
/**
* Constructor used when generating JSON
*
* @param dateProperty
*/
public JsonDatePropertyAdapter(DateProperty dateProperty) {
_dateProperty = dateProperty;
}