Import/Expoting all day iCal events that expand x days

3 Answers 83 Views
Scheduler
Kulwant
Top achievements
Rank 1
Iron
Kulwant asked on 06 May 2021, 12:04 PM

Hi, Using the demo site https://demos.telerik.com/kendo-ui/scheduler/import-export-ical I have added a all day event that expands 2 days, and then exported that data, when I import the data it changes to a 1  day event,  is this a ical.js issue?, 

 

 

export and then import i get

 

Thanks

3 Answers, 1 is accepted

Sort by
0
Martin
Telerik team
answered on 11 May 2021, 08:20 AM

Hello, Kulwant,

The custom code in the demo that handles the import/export part is not intended to work for all day events. I was not able to reproduce the issue if the All day checkbox is unchecked for events that last several days.

I hope that clears the matter. Let me know if you have any further questions.

Regards,
Martin
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.

0
Kulwant
Top achievements
Rank 1
Iron
answered on 11 May 2021, 11:37 AM

Hi Martin,

My requirement is an administrator to add ALL day events ( eg Holidays) to a global calendar, so ALL day Events checkbox is checked and cannot be changed also have the ability to import/export, ( eg they would import all bank holiday for uk, and then have the ability to add additional days if needed), hope this make sense

Thanks

0
Martin
Telerik team
answered on 14 May 2021, 09:54 AM

Hello, Kulwant,

As the iCal standard does not have an allDay property, the endTime of the Scheduler event should be expanded to the 23 hour and 59 minutes so that the event would be exported correctly in iCal file. Please check the modified version of the example:

for (var i = 0; i < schedulerEvents.length; i++) {
            var schedulerEvent = schedulerEvents[i];
            var vevent = new ICAL.Component('vevent');
            var event = new ICAL.Event(vevent);
            var endDate = schedulerEvent.end;
            var modDate = endDate.setHours(23,59,00,00);
            event.uid = schedulerEvent.recurrenceId ? schedulerEvent.recurrenceId : schedulerEvent.id;
            event.summary = schedulerEvent.title;
            event.description = schedulerEvent.description;
            event.startDate = ICAL.Time.fromDateTimeString(getISOString(schedulerEvent.start, true));
            event.endDate = ICAL.Time.fromDateTimeString(getISOString(schedulerEvent.end, true));

            if (schedulerEvent.recurrenceRule) {
              event.component.addProperty(
                new ICAL.Property(ICAL.parse.property("RRULE:" + schedulerEvent.recurrenceRule)));
            }

            if (schedulerEvent.recurrenceException) {
              event.component.addProperty(
                new ICAL.Property(ICAL.parse.property("EXDATE:" + schedulerEvent.recurrenceException)));
            }

            if (schedulerEvent.recurrenceId) {
              event.recurrenceId = ICAL.Time.fromDateTimeString(getISOString(schedulerEvent.start, true));
            }

            event.component.addPropertyWithValue("dtstamp",
                                                 ICAL.Time.fromDateTimeString(getISOString(new Date(), true)));

            component.addSubcomponent(vevent);
          }

Let me know how that works for you.

Regards,
Martin
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/.

Tags
Scheduler
Asked by
Kulwant
Top achievements
Rank 1
Iron
Answers by
Martin
Telerik team
Kulwant
Top achievements
Rank 1
Iron
Share this question
or