This is a migrated thread and some comments may be shown as answers.

import iCal javascript error

1 Answer 11 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Kulwant
Top achievements
Rank 1
Iron
Kulwant asked on 24 Apr 2021, 06:06 PM | edited on 28 Apr 2021, 08:55 AM

Hi, 

I have a few issues the Scheduler control as follows:

Problem 1

When I try to import calendar event using the demo application https://demos.telerik.com/kendo-ui/scheduler/import-export-ical  with uk bankholiday I download from https://www.calendarlabs.com/ical-calendar/holidays/uk-holidays-75/  but I get a javascript error as follows, It looks like the DTSTART:20200101 does not have a time stamp,  It would be nice if the control could validate when importing and report this to the user, I can also replicate the problem by removing the timestamp from the default data provided in the demo site, I know its a data issue but is there a workaround?

ical.min.js:1 Uncaught Error: invalid date-time value: "2020-01-01T::"

 

1 Answer, 1 is accepted

Sort by
0
Veselin Tsvetanov
Telerik team
answered on 28 Apr 2021, 09:18 AM

Hi Kulwant,

Here are the answers to your questions:

Problem 1: The error observed is thrown by the iCal library itself and not by the Kendo implementation:

ical.min.js:1 Uncaught Error: invalid date-time value: "2020-01-01T::"
    at Function.ICAL.Time.fromDateTimeString (ical.min.js:1)
    at Object.decorate (ical.min.js:1)
    at r._decorate (ical.min.js:1)
    at r._hydrateValue (ical.min.js:1)
    at r.getFirstValue (ical.min.js:1)
    at r.getFirstPropertyValue (ical.min.js:1)
    at t._firstProp (ical.min.js:1)
    at t.get startDate [as startDate] (ical.min.js:1)
    at importICal (eval at <anonymous> (jquery.min.js:2), <anonymous>:138:34)
    at FileReader.eval (eval at <anonymous> (jquery.min.js:2), <anonymous>:94:25)

Having that said, I would recommend you to direct your request to the iCal library maintaners:

https://github.com/mozilla-comm/ical.js/

Problem 2: The Scheduler widget requires a special type of DataSource schema in order to interpret and return its events in iCal format. Having that said If you are not initially using the scheduler.setDataSource() call to populate the widget, you will need to configure the schema in the widget initialization:

$("#scheduler").kendoScheduler({
  dataSource: {
    schema: kendo.data.schemas["scheduler-ical"]
  },

Here is a Dojo sample demonstrating the above approach:

https://dojo.telerik.com/EGiYEzID/7

Regards,
Veselin Tsvetanov
Progress Telerik

Тhe web is about to get a bit better! 

The Progress Hack-For-Good Challenge has started. Learn how to enter and make the web a worthier place: https://progress-worthyweb.devpost.com.

Kulwant
Top achievements
Rank 1
Iron
commented on 28 Apr 2021, 07:08 PM

Thank you
Tags
Scheduler
Asked by
Kulwant
Top achievements
Rank 1
Iron
Answers by
Veselin Tsvetanov
Telerik team
Share this question
or