public Property createProperty() { return new RecurrenceId(); } }
/** * Constructor. Date or Date-Time format is determined based on the presence of a VALUE parameter. * * @param aList a list of parameters for this component * @param aDate a date representation of a date or date-time */ public RecurrenceId(final ParameterList aList, final Date aDate) { super(RECURRENCE_ID, aList, PropertyFactoryImpl.getInstance()); setDate(aDate); }
/** * Creates a new instance initialised with the parsed value. * * @param value the RECURRENCE_ID value string to parse * @throws ParseException where the specified string is not a valid RECURRENCE_ID value representation */ public RecurrenceId(final String value) throws ParseException { super(RECURRENCE_ID, new Factory()); setValue(value); }
if(eventStamp.getEvent() != null && eventStamp.getEvent().getStartDate() != null){ DtStart startDate = eventStamp.getEvent().getStartDate(); rid = new RecurrenceId(); try { if(startDate.isUtc()){ rid.setUtc(true); }else if(startDate.getTimeZone() != null){ rid.setTimeZone(startDate.getTimeZone()); rid.setValue(recurrenceId.toString()); } catch (ParseException e) { rid = null; net.fortuna.ical4j.model.Date recurrenceIdToUse = rid == null ? recurrenceId : rid.getDate();
public void setRecurrenceId(Date date) { RecurrenceId recurrenceId = (RecurrenceId) getEvent().getProperties(). getProperty(Property.RECURRENCE_ID); if (date == null) { if (recurrenceId != null) { getEvent().getProperties().remove(recurrenceId); } return; } if (recurrenceId == null) { recurrenceId = new RecurrenceId(); getEvent().getProperties().add(recurrenceId); } recurrenceId.setDate(date); setDatePropertyValue(recurrenceId, date); }
/** * {@inheritDoc} */ public final void validate() throws ValidationException { super.validate(); /* * ; the following are optional, ; but MUST NOT occur more than once (";" "VALUE" "=" ("DATE-TIME" / "DATE)) / * (";" tzidparam) / (";" rangeparam) / */ ParameterValidator.getInstance().assertOneOrLess(Parameter.RANGE, getParameters()); /* * ; the following is optional, ; and MAY occur more than once (";" xparam) */ }
/** * Gets recurrence id. * * @param comp The component. * @return The date. */ private final Date getRecurrenceId(Component comp) { RecurrenceId rid = (RecurrenceId) comp.getProperties().getProperty( Property.RECURRENCE_ID); return (rid != null) ? rid.getDate() : null; }
if (recurrenceId.getTimeZone() != null) { TimeZone timezone = TimeZone.getTimeZone(recurrenceId.getTimeZone().getID()); format.setTimeZone(timezone != null ? timezone : DateHelper.UTC); formatInclZ.setTimeZone(timezone != null ? timezone : DateHelper.UTC); date = format.parse(recurrenceId.getValue()); } catch (ParseException e) { date = formatInclZ.parse(recurrenceId.getValue()); event.setRecurrenceReferenceId(format.format(recurrenceId.getDate()));
Range range = (Range) rid.getParameter(Parameter.RANGE); DtStart dtstart = ((VEvent)event).getStartDate(); DtEnd dtend = ((VEvent)event).getEndDate(); if (! p.intersects(getLimit())) { Dur duration = new Dur(start, end); start = new DateTime(rid.getDate()); end = (DateTime) org.unitedinternet.cosmo.calendar.util.Dates.getInstance(duration.getTime(start), start); p = new Period(start, end);
if(eventStamp.getEvent() != null && eventStamp.getEvent().getStartDate() != null){ DtStart startDate = eventStamp.getEvent().getStartDate(); rid = new RecurrenceId(); try { if(startDate.isUtc()){ rid.setUtc(true); }else if(startDate.getTimeZone() != null){ rid.setTimeZone(startDate.getTimeZone()); rid.setValue(recurrenceId.toString()); } catch (ParseException e) { rid = null; net.fortuna.ical4j.model.Date recurrenceIdToUse = rid == null ? recurrenceId : rid.getDate();
public void setRecurrenceId(Date date) { RecurrenceId recurrenceId = (RecurrenceId) getEvent().getProperties(). getProperty(Property.RECURRENCE_ID); if (date == null) { if (recurrenceId != null) { getEvent().getProperties().remove(recurrenceId); } return; } if (recurrenceId == null) { recurrenceId = new RecurrenceId(); getEvent().getProperties().add(recurrenceId); } recurrenceId.setDate(date); setDatePropertyValue(recurrenceId, date); }
/** * {@inheritDoc} */ public final void validate() throws ValidationException { super.validate(); /* * ; the following are optional, ; but MUST NOT occur more than once (";" "VALUE" "=" ("DATE-TIME" / "DATE)) / * (";" tzidparam) / (";" rangeparam) / */ ParameterValidator.getInstance().assertOneOrLess(Parameter.RANGE, getParameters()); /* * ; the following is optional, ; and MAY occur more than once (";" xparam) */ }
public Date getRecurrenceId() { RecurrenceId rid = getEvent().getRecurrenceId(); if (rid == null) { return null; } return rid.getDate(); }
Range range = (Range) rid.getParameter(Parameter.RANGE); DtStart dtstart = ((VEvent)event).getStartDate(); DtEnd dtend = ((VEvent)event).getEndDate(); if (! p.intersects(getLimit())) { Dur duration = new Dur(start, end); start = new DateTime(rid.getDate()); end = (DateTime) org.unitedinternet.cosmo.calendar.util.Dates.getInstance(duration.getTime(start), start); p = new Period(start, end);
public Property createProperty(final ParameterList parameters, final String value) throws IOException, URISyntaxException, ParseException { return new RecurrenceId(parameters, value); }
/** * Creates a new instance initialised with the parsed value. * * @param value the RECURRENCE_ID value string to parse * @throws ParseException where the specified string is not a valid RECURRENCE_ID value representation */ public RecurrenceId(final String value) throws ParseException { super(RECURRENCE_ID, new Factory()); setValue(value); }
/** * Constructor. Date or Date-Time format is determined based on the presence of a VALUE parameter. * * @param aList a list of parameters for this component * @param aDate a date representation of a date or date-time */ public RecurrenceId(final ParameterList aList, final Date aDate) { super(RECURRENCE_ID, aList, new Factory()); setDate(aDate); }
/** * {@inheritDoc} */ public final void validate() throws ValidationException { super.validate(); /* * ; the following are optional, ; but MUST NOT occur more than once (";" "VALUE" "=" ("DATE-TIME" / "DATE)) / * (";" tzidparam) / (";" rangeparam) / */ ParameterValidator.getInstance().assertOneOrLess(Parameter.RANGE, getParameters()); /* * ; the following is optional, ; and MAY occur more than once (";" xparam) */ }