var strttime = new Date('[@scheduledfor]');
var endtie = new Date('[@scheduledfortime]');
var endtie2 = new Date('2016-12-01');
var endtie3 = new Date('2016-12-01');
var request = gapi.client.calendar.events.insert({
calendarId: 'cal is correct',
start:{
date:new Date('2016-12-11')
},
end:{
date:new Date('2016-12-11')
},
任何帮助都很感激 - 就像我说如果我将日期更改为dateTime没有问题,但是一旦我打电话给整天的日期它就会打破并返回全局未找到-even的作品在谷歌的尝试中,有试过end.date,set.start,非常感谢任何帮助
作为答案的结果我已经尝试了这个并且它也不起作用 - 返回404-我之前已经尝试了但是现在会发布
var endtie2 = new Date('2016-12-13');
var endtie3 = new Date('2016-12-13');
var request = gapi.client.calendar.events.insert({
calendarId: 'a good calendar',
start: {
date: [endtie3],
timeZone: 'America/New_York'},
end: {
date: [endtie3],
timeZone: 'America/New_York'},
答案 0 :(得分:3)
尝试参考文档中的events.insert sample和Javascript quickstart:
// Refer to the JavaScript quickstart on how to setup the environment:
// https://developers.google.com/google-apps/calendar/quickstart/js
// Change the scope to 'https://www.googleapis.com/auth/calendar' and delete any
// stored credentials.
var event = {
'summary': 'Google I/O 2015',
'location': '800 Howard St., San Francisco, CA 94103',
'description': 'A chance to hear more about Google\'s developer products.',
'start': {
'dateTime': '2015-05-28T09:00:00-07:00',
'timeZone': 'America/Los_Angeles'
},
'end': {
'dateTime': '2015-05-28T17:00:00-07:00',
'timeZone': 'America/Los_Angeles'
},
'recurrence': [
'RRULE:FREQ=DAILY;COUNT=2'
],
'attendees': [
{'email': 'lpage@example.com'},
{'email': 'sbrin@example.com'}
],
'reminders': {
'useDefault': false,
'overrides': [
{'method': 'email', 'minutes': 24 * 60},
{'method': 'popup', 'minutes': 10}
]
}
};
var request = gapi.client.calendar.events.insert({
'calendarId': 'primary',
'resource': event
});
request.execute(function(event) {
appendPre('Event created: ' + event.htmlLink);
});
答案 1 :(得分:0)
当您在Google日历中插入活动时,有必要提及开始和结束时间的时区。