Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions Ical.Net/Evaluation/Evaluator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,13 @@
#nullable enable
using System;
using System.Collections.Generic;
using System.Globalization;
using Ical.Net.DataTypes;
using Ical.Net.Utility;

namespace Ical.Net.Evaluation;

public abstract class Evaluator : IEvaluator
{
protected Evaluator()
{
Calendar = CultureInfo.CurrentCulture.Calendar;
}

protected void IncrementDate(ref CalDateTime dt, RecurrencePattern pattern, int interval)
{
if (interval == 0)
Expand Down Expand Up @@ -54,7 +48,5 @@ protected void IncrementDate(ref CalDateTime dt, RecurrencePattern pattern, int
}
}

public System.Globalization.Calendar Calendar { get; private set; }

public abstract IEnumerable<Period> Evaluate(CalDateTime referenceDate, CalDateTime? periodStart, CalDateTime? periodEnd, EvaluationOptions options);
}
5 changes: 0 additions & 5 deletions Ical.Net/Evaluation/IEvaluator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,6 @@ namespace Ical.Net.Evaluation;

public interface IEvaluator
{
/// <summary>
/// The system calendar that governs the evaluation rules.
/// </summary>
System.Globalization.Calendar Calendar { get; }

/// <summary>
/// Evaluates this item to determine the dates and times for which it occurs/recurs.
/// This method only evaluates items which occur/recur between <paramref name="periodStart"/>
Expand Down
7 changes: 7 additions & 0 deletions Ical.Net/Evaluation/RecurrencePatternEvaluator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@ namespace Ical.Net.Evaluation;

public class RecurrencePatternEvaluator : Evaluator
{
/// <summary>
/// The system calendar to be used to calculate details like the week of the year, days in a month, etc.
/// We only support the gregorian calendar at this time. We take it from the InvariantCulture to avoid
/// any side effects from the local system's configuration.
/// </summary>
private static System.Globalization.Calendar Calendar { get; } = System.Globalization.CultureInfo.InvariantCulture.Calendar;

protected RecurrencePattern Pattern { get; set; }

public RecurrencePatternEvaluator(RecurrencePattern pattern)
Expand Down
Loading