javascript - 缺少结束时间谷歌日历

标签 javascript json google-api google-calendar-api

这是我的谷歌日历请求。在响应中,错误代码是“缺少结束时间”。我试图让它动态化,所以我最终会删除硬编码的开始和结束日期时间。

var object = {
        "end": {
            'dateTime': "2014-07-28T23:00:00",//end,
            "timeZone": timeZone
        },
        "start": {
            'dateTime': "2014-07-28T18:00:00",//start,
            "timeZone": timeZone
        },
        "calendarId": calendarId,
        "summary": artist,
        "description": description,
        "location": address
    };
    var request = gapi.client.calendar.events.insert(object);

最佳答案

这个人有答案

https://groups.google.com/forum/#!msg/google-calendar-api/cnkgXfy_GQQ/SRV1N0TAGtYJ

    var object = {
        'end': {
            'dateTime': '2014-07-28T23:00:00',//end,
            'timeZone': timeZone
        },
        'start': {
            'dateTime': '2014-07-28T18:00:00',//start,
            'timeZone': timeZone
        }
        //'summary': artist,
        //'description': description,
        //'location': address
    };
    var calendarObject =
    {
        'calendarId': calendarId,
        'resource': object
    };
    var request = gapi.client.calendar.events.insert(calendarObject);

关于javascript - 缺少结束时间谷歌日历,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24990486/

相关文章:

javascript - Ember 反向对象无法正常工作

json - 错误 TS2339 : Property 'results' does not exist on type 'Response'

c# - 如何根据元素的值之一将 json 数组的每个元素反序列化为其适当的子类? (C#)

php - 如何将 JSON 转换为 SQL 查询 - php

ruby - 为什么在使用 Ruby 执行 Google Fusion Tables API 命令时会出现 401 错误?

google-api - 使用 Google 日历 api 获取 session 链接

javascript - jQuery DataTable 在尝试隐藏列时多次触发

javascript - jQuery UI Bounce 进度条

jquery - 将youtube视频添加到网络应用

javascript - 以 Express 方式发送上传的图像