New to Telerik UI for ASP.NET AJAX? Start a free 30-day trial

Occurrences of this rule repeat on a daily basis.

Definition

Namespace:Telerik.Web.UI

Assembly:Telerik.Web.UI.dll

Syntax:

C#
public class DailyRecurrenceRule : RecurrenceRule, ISerializable, IEquatable<RecurrenceRule>

Inheritance: objectRecurrenceRuleDailyRecurrenceRule

Implements: IEquatable<RecurrenceRule>ISerializable

Inherited Members RecurrenceRule.rulePatternRecurrenceRule.ruleRangeRecurrenceRule.EmptyRecurrenceRule.FromPatternAndRange(RecurrencePattern, RecurrenceRange)RecurrenceRule.TryParse(string, out RecurrenceRule)RecurrenceRule.TryParse(string)RecurrenceRule.TryParse(string, string, out RecurrenceRule)RecurrenceRule.IsValidValue<T>(T, T, T)RecurrenceRule.ValidateValue<T>(string, T, T, T)RecurrenceRule.SetEffectiveRange(DateTime, DateTime)RecurrenceRule.ClearEffectiveRange()RecurrenceRule.ToString()RecurrenceRule.ToString(TimeZoneInfoProvider)RecurrenceRule.GetHashCode()RecurrenceRule.Equals(object)RecurrenceRule.Equals(RecurrenceRule)RecurrenceRule.MatchDayOfWeekMask(DateTime)RecurrenceRule.MatchDayOrdinal(DateTime)RecurrenceRule.GetObjectData(SerializationInfo, StreamingContext)RecurrenceRule.RangeRecurrenceRule.PatternRecurrenceRule.OccurrencesRecurrenceRule.HasOccurrencesRecurrenceRule.ExceptionsRecurrenceRule.HasExceptionsRecurrenceRule.MaximumCandidatesRecurrenceRule.EffectiveStartobject.Equals(object, object)object.ReferenceEquals(object, object)object.GetType()object.MemberwiseClone()...

Example:

csharp
using System;
using Telerik.Web.UI;

namespace RecurrenceExamples
{
    class DailyRecurrenceRuleExample1
    {
        static void Main()
        {
            // Creates a sample appointment that starts at 6/1/2007 3:30 PM (local time) and lasts half an hour.
            Appointment recurringAppointment = new Appointment("1", Convert.ToDateTime("6/1/2007 3:30 PM"),
                Convert.ToDateTime("6/1/2007 4:00 PM"), "Sample appointment");

            // Creates a recurrence range, that specifies a limit of 10 occurrences for the appointment.
            RecurrenceRange range = new RecurrenceRange();
            range.Start = recurringAppointment.Start;
            range.EventDuration = recurringAppointment.End - recurringAppointment.Start;
            range.MaxOccurrences = 10;

            // Creates a recurrence rule to repeat the appointment every two days.
            DailyRecurrenceRule rrule = new DailyRecurrenceRule(2, range);

            Console.WriteLine("Appointment occurrs at the following times: ");
            int ix = 0;
            foreach (DateTime occurrence in rrule.Occurrences)
            {
                ix = ix + 1;
                Console.WriteLine("{0,2}: {1} ({2})", ix, occurrence.ToLocalTime(), occurrence.DayOfWeek);
            }
        }
    }
}

/*
This example produces the following results:

Appointment occurrs at the following times:
 1: 6/1/2007 3:30:00 PM (Friday)
 2: 6/3/2007 3:30:00 PM (Sunday)
 3: 6/5/2007 3:30:00 PM (Tuesday)
 4: 6/7/2007 3:30:00 PM (Thursday)
 5: 6/9/2007 3:30:00 PM (Saturday)
 6: 6/11/2007 3:30:00 PM (Monday)
 7: 6/13/2007 3:30:00 PM (Wednesday)
 8: 6/15/2007 3:30:00 PM (Friday)
 9: 6/17/2007 3:30:00 PM (Sunday)
10: 6/19/2007 3:30:00 PM (Tuesday)
*/
csharp
Imports System
Imports Telerik.Web.UI

Namespace RecurrenceExamples
    Class DailyRecurrenceRuleExample1
        Shared Sub Main()
            ' Creates a sample appointment that starts at 6/1/2007 3:30 PM (local time) and lasts half an hour.
            Dim recurringAppointment As New Appointment("1", Convert.ToDateTime("6/1/2007 3:30 PM"), Convert.ToDateTime("6/1/2007 4:00 PM"), "Sample appointment")

            ' Creates a recurrence range, that specifies a limit of 10 occurrences for the appointment.
            Dim range As New RecurrenceRange()
            range.Start = recurringAppointment.Start
            range.EventDuration = recurringAppointment.[End] - recurringAppointment.Start
            range.MaxOccurrences = 10

            ' Creates a recurrence rule to repeat the appointment every two days.
            Dim rrule As New DailyRecurrenceRule(2, range)

            Console.WriteLine("Appointment occurrs at the following times: ")
            Dim ix As Integer = 0
            For Each occurrence As DateTime In rrule.Occurrences
                ix = ix + 1
                Console.WriteLine("{0,2}: {1} ({2})", ix, occurrence.ToLocalTime(), occurrence.DayOfWeek)
            Next
        End Sub
    End Class
End Namespace

'
'This example produces the following results:
'
'Appointment occurrs at the following times:
' 1: 6/1/2007 3:30:00 PM (Friday)
' 2: 6/3/2007 3:30:00 PM (Sunday)
' 3: 6/5/2007 3:30:00 PM (Tuesday)
' 4: 6/7/2007 3:30:00 PM (Thursday)
' 5: 6/9/2007 3:30:00 PM (Saturday)
' 6: 6/11/2007 3:30:00 PM (Monday)
' 7: 6/13/2007 3:30:00 PM (Wednesday)
' 8: 6/15/2007 3:30:00 PM (Friday)
' 9: 6/17/2007 3:30:00 PM (Sunday)
'10: 6/19/2007 3:30:00 PM (Tuesday)
'

Constructors

Initializes a new instance of DailyRecurrenceRule with the specified interval (in days) and RecurrenceRange.

C#
public DailyRecurrenceRule(int interval, RecurrenceRange range)
Parameters:intervalint

The number of days between the occurrences.

rangeRecurrenceRange

The RecurrenceRange instance that specifies the range of this recurrence rule.

Example:
cs-api-definition
using System;
using Telerik.Web.UI;

namespace RecurrenceExamples
{
class DailyRecurrenceRuleExample1
{
static void Main()
{
// Creates a sample appointment that starts at 6/1/2007 3:30 PM (local time) and lasts half an hour.
Appointment recurringAppointment = new Appointment("1", Convert.ToDateTime("6/1/2007 3:30 PM"),
Convert.ToDateTime("6/1/2007 4:00 PM"), "Sample appointment");

// Creates a recurrence range, that specifies a limit of 10 occurrences for the appointment.
RecurrenceRange range = new RecurrenceRange();
range.Start = recurringAppointment.Start;
range.EventDuration = recurringAppointment.End - recurringAppointment.Start;
range.MaxOccurrences = 10;

// Creates a recurrence rule to repeat the appointment every two days.
DailyRecurrenceRule rrule = new DailyRecurrenceRule(2, range);

Console.WriteLine("Appointment occurrs at the following times: ");
int ix = 0;
foreach (DateTime occurrence in rrule.Occurrences)
{
ix = ix + 1;
Console.WriteLine("{0,2}: {1} ({2})", ix, occurrence.ToLocalTime(), occurrence.DayOfWeek);
}
}
}
}

/*
This example produces the following results:

Appointment occurrs at the following times:
1: 6/1/2007 3:30:00 PM (Friday)
2: 6/3/2007 3:30:00 PM (Sunday)
3: 6/5/2007 3:30:00 PM (Tuesday)
4: 6/7/2007 3:30:00 PM (Thursday)
5: 6/9/2007 3:30:00 PM (Saturday)
6: 6/11/2007 3:30:00 PM (Monday)
7: 6/13/2007 3:30:00 PM (Wednesday)
8: 6/15/2007 3:30:00 PM (Friday)
9: 6/17/2007 3:30:00 PM (Sunday)
10: 6/19/2007 3:30:00 PM (Tuesday)
*/

Initializes a new instance of DailyRecurrenceRule with the specified days of week bit mask and RecurrenceRange.

C#
public DailyRecurrenceRule(RecurrenceDay daysOfWeekMask, RecurrenceRange range)
Parameters:daysOfWeekMaskRecurrenceDay

A bit mask that specifies the week days on which the event recurs.

rangeRecurrenceRange

The RecurrenceRange instance that specifies the range of this recurrence rule.

Example:
cs-api-definition
using System;
using Telerik.Web.UI;

namespace RecurrenceExamples
{
class DailyRecurrenceRuleExample2
{
static void Main()
{
// Creates a sample appointment that starts at 6/1/2007 3:30 PM (local time) and lasts half an hour.
Appointment recurringAppointment = new Appointment("1", Convert.ToDateTime("6/1/2007 3:30 PM"),
Convert.ToDateTime("6/1/2007 4:00 PM"), "Sample appointment");

// Creates a recurrence range, that specifies a limit of 10 occurrences for the appointment.
RecurrenceRange range = new RecurrenceRange();
range.Start = recurringAppointment.Start;
range.EventDuration = recurringAppointment.End - recurringAppointment.Start;
range.MaxOccurrences = 10;

// Creates a recurrence rule to repeat the appointment every week day.
DailyRecurrenceRule rrule = new DailyRecurrenceRule(RecurrenceDay.WeekDays, range);

Console.WriteLine("Appointment occurrs at the following times: ");
int ix = 0;
foreach (DateTime occurrence in rrule.Occurrences)
{
ix = ix + 1;
Console.WriteLine("{0,2}: {1} ({2})", ix, occurrence.ToLocalTime(), occurrence.DayOfWeek);
}
}
}
}

/*
This example produces the following results:

Appointment occurrs at the following times:
1: 6/1/2007 3:30:00 PM (Friday)
2: 6/4/2007 3:30:00 PM (Monday)
3: 6/5/2007 3:30:00 PM (Tuesday)
4: 6/6/2007 3:30:00 PM (Wednesday)
5: 6/7/2007 3:30:00 PM (Thursday)
6: 6/8/2007 3:30:00 PM (Friday)
7: 6/11/2007 3:30:00 PM (Monday)
8: 6/12/2007 3:30:00 PM (Tuesday)
9: 6/13/2007 3:30:00 PM (Wednesday)
10: 6/14/2007 3:30:00 PM (Thursday)
*/

Properties

Gets or sets the bit mask that specifies the week days on which the event recurs.

C#
public RecurrenceDay DaysOfWeekMask { get; set; }
Property Value:

A bit mask that specifies the week days on which the event recurs.

For additional information on how to create masks see the RecurrenceDay documentation.

Gets the interval (in days) between the occurrences.

C#
public int Interval { get; }
Property Value:

The interval (in days) between the occurrences.

Methods

C#
protected override DateTime GetOccurrenceStart(int index)
Parameters:indexintReturns:

DateTime

Overrides: RecurrenceRule.GetOccurrenceStart(int)

C#
protected override bool MatchAdvancedPattern(DateTime start)
Parameters:startDateTimeReturns:

bool

Overrides: RecurrenceRule.MatchAdvancedPattern(DateTime)