/** * Returns the latest applicable timezone observance for the specified date. * @param date the latest possible date for a timezone observance onset * @return the latest applicable timezone observance for the specified date or null if there are no applicable * observances */ public final Observance getApplicableObservance(final Date date) { Observance latestObservance = null; Date latestOnset = null; for (final Observance observance : getObservances()) { final Date onset = observance.getLatestOnset(date); if (latestOnset == null || (onset != null && onset.after(latestOnset))) { latestOnset = onset; latestObservance = observance; } } return latestObservance; }
/** * Returns the latest applicable timezone observance for the specified date. * @param date the latest possible date for a timezone observance onset * @return the latest applicable timezone observance for the specified date or null if there are no applicable * observances */ public final Observance getApplicableObservance(final Date date) { Observance latestObservance = null; Date latestOnset = null; for (final Observance observance : getObservances()) { final Date onset = observance.getLatestOnset(date); if (latestOnset == null || (onset != null && onset.after(latestOnset))) { latestOnset = onset; latestObservance = observance; } } return latestObservance; }
/** * Returns the latest applicable timezone observance for the specified date. * @param date the latest possible date for a timezone observance onset * @return the latest applicable timezone observance for the specified date or null if there are no applicable * observances */ public final Observance getApplicableObservance(final Date date) { Observance latestObservance = null; Date latestOnset = null; for (final Observance observance : getObservances()) { final Date onset = observance.getLatestOnset(date); if (latestOnset == null || (onset != null && onset.after(latestOnset))) { latestOnset = onset; latestObservance = observance; } } return latestObservance; }
/** * Returns the latest applicable timezone observance for the specified date. * @param date the latest possible date for a timezone observance onset * @return the latest applicable timezone observance for the specified date or null if there are no applicable * observances */ public final Observance getApplicableObservance(final Date date) { Observance latestObservance = null; Date latestOnset = null; for (final Observance observance : getObservances()) { final Date onset = observance.getLatestOnset(date); if (latestOnset == null || (onset != null && onset.after(latestOnset))) { latestOnset = onset; latestObservance = observance; } } return latestObservance; }
/** * Returns the latest applicable timezone observance for the specified date. * @param date the latest possible date for a timezone observance onset * @return the latest applicable timezone observance for the specified date or null if there are no applicable * observances */ public final Observance getApplicableObservance(final Date date) { Observance latestObservance = null; Date latestOnset = null; for (final Iterator i = getObservances().iterator(); i.hasNext();) { final Observance observance = (Observance) i.next(); final Date onset = observance.getLatestOnset(date); if (latestOnset == null || (onset != null && onset.after(latestOnset))) { latestOnset = onset; latestObservance = observance; } } return latestObservance; }
if (!startRange.after(start)) { return startRange;
if (!startRange.after(start)) { return startRange;
final Date candidateSeed = Dates.getInstance(cal.getTime(), value); if (getUntil() != null && candidate != null && candidate.after(getUntil())) { break; if (!candidate.after(startDate)) { invalidCandidateCount++; } else if (getCount() > 0 break; } else if (!(getUntil() != null && candidate.after(getUntil()))) { return candidate;
private static boolean isEventValid(VEvent event, ValidationConfig config) { if (config == null) { LOG.error("ValidationConfig cannot be null"); return false; } 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); }
private static boolean isEventValid(VEvent event, ValidationConfig config) { if (config == null) { LOG.error("ValidationConfig cannot be null"); return false; } 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); }
final Date candidateSeed = Dates.getInstance(cal.getTime(), value); if (getUntil() != null && candidate != null && candidate.after(getUntil())) { break; if (!candidate.after(startDate)) { invalidCandidateCount++; } else if (getCount() > 0 break; } else if (!(getUntil() != null && candidate.after(getUntil()))) { return candidate;
final Date candidateSeed = Dates.getInstance(cal.getTime(), value); if (getUntil() != null && candidate != null && candidate.after(getUntil())) { break; if (!candidate.after(startDate)) { invalidCandidateCount++; } else if (getCount() > 0 break; } else if (!(getUntil() != null && candidate.after(getUntil()))) { return candidate;
/** * */ public void testGetDatesOrdering() { DateList dl1 = recur.getDates(periodStart, periodEnd, value); Date prev = null; Date event = null; for(int i=0; i<dl1.size(); i++) { prev = event; event = (Date) dl1.get(i); log.debug("Occurence "+i+" at "+event); assertTrue(prev == null || !prev.after(event)); } }
/** * 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()) ; }
/** * 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()) ; }
String firstKey = (String) instances.firstKey(); Instance instance = (Instance) instances.remove(firstKey); if(instance.getStart().after(rangeStart)) { if(instance.isOverridden()) { ModificationUid modUid = new ModificationUidImpl(note, instance.getRid());
String firstKey = (String) instances.firstKey(); Instance instance = (Instance) instances.remove(firstKey); if(instance.getStart().after(rangeStart)) { if(instance.isOverridden()) { ModificationUid modUid = new ModificationUidImpl(note, instance.getRid());
? event.getStartDate().getDate() :new Date(); boolean later = eventStartDate.after(now); int code = later ? TriageStatus.CODE_LATER : TriageStatus.CODE_DONE;
? event.getStartDate().getDate() :new Date(); boolean later = eventStartDate.after(now); int code = later ? TriageStatus.CODE_LATER : TriageStatus.CODE_DONE;
maxRangeEnd); if ((rr.rangeEnd == null) || (rr.rangeEnd.after(maxRangeEnd))) { rr.rangeEnd = maxRangeEnd;