SfSchedule : Using query and reports

Hello

We use the SfSchedule tool for the shift plan in our application. The user interface is very good and definitely meets our needs.

In an example scenario: We define a morning shift between 08:00 - 12:00 every day. It creates a record like the one below.

StartTime: 2022-01-02 08:00:00.0000000

EndTime: 2022-01-02 12:00:00.0000000

RecurrenceRule : FREQ=WEEKLY;BYDAY=MO,TU,WE,TH,FR;INTERVAL=1;

I want to generate report using this definition. For example:

How many working hours on which days?

In this case, how can I use the structure in the RecurrenceRule field in the query in the easiest and fastest way.

Regards

Thank you


1 Reply

RM Ruksar Moosa Sait Syncfusion Team April 12, 2022 01:40 PM UTC

Hi Seckin,


You can generate the dates from the RecurrenceRule by using our public method GetRecurrenceDates of the SfRecurrenceEditor like the below code.


public void GetDates()

    {

        List<DateTime> Dates = RecurrenceEditorRef.GetRecurrenceDates(new DateTime(2020, 1, 15, 8, 0, 0),"FREQ=WEEKLY;BYDAY=MO,TU,WE,TH,FR;INTERVAL=1");

        for(int i=0; i < Dates.Count; i++)

        {

            Console.WriteLine(Dates[i]);

        }

    }


Output Screenshot:

Graphical user interface, text, table

Description automatically generated


Kindly try the attached sample and let us know if this meets your requirements.


Regards,

Ruksar Moosa Sait


Attachment: GenerateRecurrenceDates_7c9ee062.zip

Loader.
Up arrow icon