public override IList <IPeriod> Evaluate(IDateTime referenceDate, DateTime periodStart, DateTime periodEnd, bool includeReferenceDateInResults) { // Create a recurrence pattern suitable for use during evaluation. IRecurrencePattern pattern = ProcessRecurrencePattern(referenceDate); // Enforce evaluation restrictions on the pattern. EnforceEvaluationRestrictions(pattern); Periods.Clear(); foreach (DateTime dt in GetDates(referenceDate, periodStart, periodEnd, -1, pattern, includeReferenceDateInResults)) { // Turn each resulting date/time into an IDateTime and associate it // with the reference date. IDateTime newDt = new iCalDateTime(dt, referenceDate.TZID); // NOTE: fixes bug #2938007 - hasTime missing newDt.HasTime = referenceDate.HasTime; newDt.AssociateWith(referenceDate); // Create a period from the new date/time. IPeriod p = new Period(newDt); if (!Periods.Contains(p)) { Periods.Add(p); } } return(Periods); }
protected IDateTime ConvertToIDateTime(DateTime dt, IDateTime referenceDate) { IDateTime newDt = new iCalDateTime(dt, referenceDate.TZID); newDt.AssociateWith(referenceDate); return(newDt); }
IPeriod CreatePeriod(DateTime dt, IDateTime referenceDate) { // Turn each resulting date/time into an IDateTime and associate it // with the reference date. IDateTime newDt = new iCalDateTime(dt, referenceDate.TzId); // NOTE: fixes bug #2938007 - hasTime missing newDt.HasTime = referenceDate.HasTime; newDt.AssociateWith(referenceDate); // Create a period from the new date/time. return(new Period(newDt)); }
IPeriod CreatePeriod(DateTime dt, IDateTime referenceDate) { // Turn each resulting date/time into an IDateTime and associate it // with the reference date. IDateTime newDt = new iCalDateTime(dt, referenceDate.TZID); // NOTE: fixes bug #2938007 - hasTime missing newDt.HasTime = referenceDate.HasTime; newDt.AssociateWith(referenceDate); // Create a period from the new date/time. return new Period(newDt); }
protected IDateTime ConvertToIDateTime(DateTime dt, IDateTime referenceDate) { IDateTime newDt = new iCalDateTime(dt, referenceDate.TZID); newDt.AssociateWith(referenceDate); return newDt; }
public override IList<IPeriod> Evaluate(IDateTime referenceDate, DateTime periodStart, DateTime periodEnd, bool includeReferenceDateInResults) { // Create a recurrence pattern suitable for use during evaluation. IRecurrencePattern pattern = ProcessRecurrencePattern(referenceDate); // Enforce evaluation restrictions on the pattern. EnforceEvaluationRestrictions(pattern); Periods.Clear(); foreach (DateTime dt in GetDates(referenceDate, periodStart, periodEnd, -1, pattern, includeReferenceDateInResults)) { // Turn each resulting date/time into an IDateTime and associate it // with the reference date. IDateTime newDt = new iCalDateTime(dt, referenceDate.TZID); // NOTE: fixes bug #2938007 - hasTime missing newDt.HasTime = referenceDate.HasTime; newDt.AssociateWith(referenceDate); // Create a period from the new date/time. IPeriod p = new Period(newDt); if (!Periods.Contains(p)) Periods.Add(p); } return Periods; }