How to validate if ical ( iCalendar ) file is valid using javascript?

守給你的承諾、 提交于 2021-01-29 06:51:08

问题


Is there any javascript library which I can use to validate if ical file is valid.

Below is invalid ical file content example

BEGIN:VCALENDAR
END:VCALENDAR

Looks like https://github.com/mozilla-comm/ical.js/ is not useful. Unable to invalidate above ical file.

There is no event. This is also failing with icalendar.org/validator.html ( would like to see something like this )


回答1:


You can try to use server-side validation by https://icalendar.org/validator.html They have an option to show errors in JSON format from ical feed from URL

https://icalendar.org/validator.html?url=https://example.com/somecalendar_feed&json=1



来源:https://stackoverflow.com/questions/57858011/how-to-validate-if-ical-icalendar-file-is-valid-using-javascript

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!