簡體   English   中英

Google日歷活動會插入

[英]Google calendar events insert

離開我的腦海,並希望有一些洞察力 - 我通過谷歌javascript插入一個事件,並且整天活動似乎不想工作 - 可以輕松地做一個非全天活動,但似乎“約會”不起作用

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工作在谷歌的嘗試,已嘗試結束。 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'},

嘗試參考events.insert示例和文檔中的Javascript快速入門

// 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);
});

在Google日歷中插入活動時,有必要提及開始和結束時間的時區。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM