Unplanned
Last Updated: 24 Jul 2021 09:07 by ADMIN
Annabel
Created on: 23 Jul 2021 11:33
Category: Scheduler
Type: Bug Report
6
RecurrenceRule does not support the RFC5545 date format like "20210722T000000"

The following date in the Scheduler RecurrenceRule cannot be parsed and is ignored:

RecurrenceRule = "FREQ=DAILY;UNTIL=20210722T000000"

According to the RFC5545 specification, this should be a valid date format.

These formats will work:

RecurrenceRule = "FREQ=DAILY;UNTIL=2021-07-22T00:00:00"
RecurrenceRule = "FREQ=DAILY;UNTIL=2021-07-22T00:00:00.000Z"

 

EDIT:

This is my work-around. It captures the date portion of the UNTIL clause, converts it into the date string style that Telerik can understand, then reassembles the rule string

private string TransformRecurrenceRule()
        {
            const string untilSeparator = "UNTIL=";
            var ruleParts = RecurrenceRule.Split(untilSeparator, StringSplitOptions.RemoveEmptyEntries);
            if (ruleParts.Length <= 1)
            {
                // There was no Until clause to worry about
                return RecurrenceRule;
            }

            // Save the first part of the rule
            var ruleBeginning = ruleParts[0];

            // Split the date part of the until clause from any following clauses
            var remainingClauses = ruleParts[1].Split(';', 2, StringSplitOptions.RemoveEmptyEntries);

            //Save the date part of the until clause
            var untilDate = remainingClauses[0];

            // Save any following clauses with the `;` replaced
            var ruleEnding = "";
            if (remainingClauses.Length == 2)
            {
                ruleEnding = $";{remainingClauses[1]}";

            }

            // Convert the until date into .net parsable format
            const string format = "yyyyMMddTHHmmss";
            var date = DateTime.ParseExact(untilDate, format, CultureInfo.InvariantCulture);
            var dateStr = date.ToString("yyyy-MM-ddTHH:mm:ss");

            // recombine rule components
            var newRuleParts = new[] {ruleBeginning, untilSeparator, dateStr, ruleEnding};
            var newRule = string.Join("",newRuleParts);

            return newRule;
        }

3 comments
ADMIN
Marin Bratanov
Posted on: 24 Jul 2021 09:07

Hi Annabel,

Thank you for sharing this with the community, I have hoisted it into the opener post for better visibility and you will also find your Telerik points updated as a small "thank you".

Regards,
Marin Bratanov
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Annabel
Posted on: 23 Jul 2021 16:57

I figured I would post my work-around here as well. It captures the date portion of the UNTIL clause, converts it into the date string style that Telerik can understand, then reassembles the rule string

```

private string TransformRecurrenceRule()
        {
            const string untilSeparator = "UNTIL=";
            var ruleParts = RecurrenceRule.Split(untilSeparator, StringSplitOptions.RemoveEmptyEntries);
            if (ruleParts.Length <= 1)
            {
                // There was no Until clause to worry about
                return RecurrenceRule;
            }

            // Save the first part of the rule
            var ruleBeginning = ruleParts[0];

            // Split the date part of the until clause from any following clauses
            var remainingClauses = ruleParts[1].Split(';', 2, StringSplitOptions.RemoveEmptyEntries);

            //Save the date part of the until clause
            var untilDate = remainingClauses[0];

            // Save any following clauses with the `;` replaced
            var ruleEnding = "";
            if (remainingClauses.Length == 2)
            {
                ruleEnding = $";{remainingClauses[1]}";

            }

            // Convert the until date into .net parsable format
            const string format = "yyyyMMddTHHmmss";
            var date = DateTime.ParseExact(untilDate, format, CultureInfo.InvariantCulture);
            var dateStr = date.ToString("yyyy-MM-ddTHH:mm:ss");

            // recombine rule components
            var newRuleParts = new[] {ruleBeginning, untilSeparator, dateStr, ruleEnding};
            var newRule = string.Join("",newRuleParts);

            return newRule;
        }

```

ADMIN
Dimo
Posted on: 23 Jul 2021 11:51

Hi Annabel,

Thank you for bringing the issue to our attention. We confirmed it and you will receive email notifications for status updates.

Regards,
Dimo
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.