zhaoyou
zhaoyou

Reputation: 308

Add Event to Google Calendar Don't work

It works in the explorer, but not on my server. I used Coffee in Node.js Server with Google Client Service access Calendar(token which got it, using start.date is work also but start.dateTime don't work).

   request.post
      url: calendarRoot + "/calendars/****@group.calendar.google.com/events" + token,
      json: true
      headers:
       'Content-Type': 'application/json'
      body: JSON.stringify
        "start":
          "dateTime": "2014-02-21T09:30:00"
          "timeZone": 'Asia/Shanghai'
        "end":
          "dateTime": "2014-02-22T18:00:00"
          "timeZone": 'Asia/Shanghai'
        "summary": options.summary
        "description": options.description
      (err, res, body)->
        callback(err, body)

I console.log body , error message:

message: 'Invalid value for: Invalid format: "2014-02-24" is too short'

why Invalid format "2014-02-24" ? may be timezone error ?

Thanks.

Upvotes: 2

Views: 2911

Answers (1)

Venkatesh Bachu
Venkatesh Bachu

Reputation: 2553

try with below format

YYYY-MM-DDTHH:MM:SS.SSSZ
ex: 2014-02-22T18:00:00.000Z

Upvotes: 8

Related Questions