public boolean checkMoment(Date date) { if (calendar != null) { Period period = new Period(new DateTime(date), new Dur(0, 0, 0, 0)); Predicate<CalendarComponent> periodRule = new PeriodRule<>(period); Filter<CalendarComponent> filter = new Filter<>(new Predicate[] {periodRule}, Filter.MATCH_ANY); Collection<CalendarComponent> events = filter.filter(calendar.getComponents(CalendarComponent.VEVENT)); if (events != null && !events.isEmpty()) { return true; } } return false; }
/** * Provides a negation of this instance. * @return a Dur instance that represents a negation of this instance */ public final Dur negate() { final Dur negated = new Dur(days, hours, minutes, seconds); negated.weeks = weeks; negated.negative = !negative; return negated; }
/** * Provides a negation of this instance. * @return a Dur instance that represents a negation of this instance */ public final Dur negate() { final Dur negated = new Dur(days, hours, minutes, seconds); negated.weeks = weeks; negated.negative = !negative; return negated; }
/** * Factory constructor. * @param params property parameters * @param value string representation of a property value */ public BookingWindowEnd(final List<Parameter> params, final String value) { super(Id.BOOKINGWINDOWEND, params); this.value = new Dur(value); }
/** * Factory constructor. * @param params property parameters * @param value string representation of a property value */ public BookingWindowStart(final List<Parameter> params, final String value) { super(Id.BOOKINGWINDOWSTART, params); this.value = new Dur(value); }
/** * Provides a negation of this instance. * @return a Dur instance that represents a negation of this instance */ public final Dur negate() { final Dur negated = new Dur(days, hours, minutes, seconds); negated.weeks = weeks; negated.negative = !negative; return negated; }
/** * Provides a negation of this instance. * @return a Dur instance that represents a negation of this instance */ public final Dur negate() { final Dur negated = new Dur(days, hours, minutes, seconds); negated.weeks = weeks; negated.negative = !negative; return negated; }
/** * Provides a negation of this instance. * @return a Dur instance that represents a negation of this instance */ public final Dur negate() { final Dur negated = new Dur(days, hours, minutes, seconds); negated.weeks = weeks; negated.negative = !negative; return negated; }
/** * {@inheritDoc} */ public final void setValue(final String aValue) { // duration = DurationFormat.getInstance().parse(aValue); duration = new Dur(aValue); }
/** * {@inheritDoc} */ public final void setValue(final String aValue) { // duration = DurationFormat.getInstance().parse(aValue); duration = new Dur(aValue); }
/** * {@inheritDoc} */ public final void setValue(final String aValue) { try { super.setValue(aValue); duration = null; } catch (ParseException pe) { duration = new Dur(aValue); super.setDateTime(null); } }
/** * Returns the duration of this period. If an explicit duration is not * specified, the duration is derived from the end date. * * @return the duration of this period in milliseconds. */ public final Dur getDuration() { if (duration == null) { return new Dur(getStart(), getEnd()); } return duration; }
/** * Constructs a new duration representing the time between the specified start date and end date. * @param start the starting time for the duration * @param end the end time for the duration */ public Duration(final Date start, final Date end) { super(DURATION, PropertyFactoryImpl.getInstance()); setDuration(new Dur(start, end)); }
/** * Returns the duration of this period. If an explicit duration is not * specified, the duration is derived from the end date. * * @return the duration of this period in milliseconds. */ public final Dur getDuration() { if (duration == null) { return new Dur(getStart(), getEnd()); } return duration; }
/** * Returns the duration of this period. If an explicit duration is not * specified, the duration is derived from the end date. * * @return the duration of this period in milliseconds. */ public final Dur getDuration() { if (duration == null) { return new Dur(getStart(), getEnd()); } return duration; }
/** * {@inheritDoc} */ public final void setValue(final String aValue) { try { super.setValue(aValue); duration = null; } catch (ParseException pe) { duration = new Dur(aValue); super.setDateTime(null); } }
/** * Constructs a new duration representing the time between the specified start date and end date. * * @param start the starting time for the duration * @param end the end time for the duration */ public Duration(final Date start, final Date end) { super(DURATION, PropertyFactoryImpl.getInstance()); setDuration(new Dur(start, end)); }
/** Make an ical Dur from a start and end * * @param start * @param end * @return Dur * @throws CalFacadeException */ public static Dur makeDuration(final BwDateTime start, final BwDateTime end) throws CalFacadeException { return new Dur(start.makeDate(), end.makeDate()); }
/** * Constructs a new duration representing the time between the specified start date and end date. * * @param start the starting time for the duration * @param end the end time for the duration */ public Duration(final Date start, final Date end) { super(DURATION, PropertyFactoryImpl.getInstance()); setDuration(new Dur(start, end)); }
protected static VAlarm createAlarm(GenericValue workEffortEventReminder) { VAlarm alarm = null; Timestamp reminderStamp = workEffortEventReminder.getTimestamp("reminderDateTime"); if (reminderStamp != null) { alarm = new VAlarm(new DateTime(reminderStamp)); } else { TimeDuration duration = TimeDuration.fromNumber(workEffortEventReminder.getLong("reminderOffset")); alarm = new VAlarm(new Dur(duration.days(), duration.hours(), duration.minutes(), duration.seconds())); } return alarm; }