我正在尝试获取一个按钮,以将事件添加到onclick的电话日历中。
我正在使用以下NPM软件包:https://github.com/matthiasanderer/icsFormatter(如果有更好的软件包,请告诉我)
以下是问题的视频:
VEVENT结构为:
var calendarEvent = [
'BEGIN:VEVENT',
'CLASS:PUBLIC',
'DESCRIPTION:' + description,
'DTSTART;VALUE=DATE:' + start,
'DTEND;VALUE=DATE:' + end,
'LOCATION:' + location,
'SUMMARY;LANGUAGE=en-us:' + subject,
'TRANSP:TRANSPARENT',
'END:VEVENT'
].join(SEPARATOR);
我用来输入ICS文件的代码是:
var now = Date.now()
var calEntry = this.icsFormatter()
var title = 'sometitlestring';
var place = 'our secret meeting place';
var begin = new Date(now);
var end = new Date(now+1);
var description = 'A very long and boring description of what is the agenda of this super exclusiv pow-wow';
calEntry.addEvent(title,description, place, begin.toUTCString(), begin.toUTCString());
calEntry.download('ourSecretMeeting');
我了解Safari Mobile对iCal格式可能会非常挑剔。以前有没有人成功解决过此类问题?如果是这样,您在做什么?