Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/453.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Alfresco-使用服务器端javascript的日历事件_Javascript_Alfresco_Alfresco Webscripts - Fatal编程技术网

Alfresco-使用服务器端javascript的日历事件

Alfresco-使用服务器端javascript的日历事件,javascript,alfresco,alfresco-webscripts,Javascript,Alfresco,Alfresco Webscripts,如何使用服务器端javascript代码创建日历事件?以下是创建日历事件的代码 var node = companyhome.childByNamePath("Sites/demo/calendar"); var myEvent = node.createNode(new Date().getTime() + "-" + Math.round(Math.random()*10000) + ".ics", "ia:calend

如何使用服务器端javascript代码创建日历事件?

以下是创建日历事件的代码

var node = companyhome.childByNamePath("Sites/demo/calendar"); 
var myEvent = node.createNode(new Date().getTime() + "-" + Math.round(Math.random()*10000) + ".ics", "ia:calendarEvent")
myEvent.properties["ia:whereEvent"] = "Where event";
myEvent.properties["ia:descriptionEvent"] = "This is the description";
myEvent.properties["ia:whatEvent"] = "What event";


var fromDate = new Date();
var fromISODate = utils.toISO8601(fromDate);
myEvent.properties["ia:fromDate"] = fromISODate;

var toDate = new Date();
toDate.setHours(toDate.getHours() + 3);
var toISODate = utils.toISO8601(toDate);
myEvent.properties["ia:toDate"] = toISODate;


myEvent.save();
logger.warn("Created new calendar event: " + myEvent.nodeRef);