Reputation: 91
I am trying to create a calendar event for a project but the dates for the calendar event are not being properly set.
Here is the JSON data I am passing to the service
{
"summary":"New Calendar Item #2",
"description":"Details to follow",
"all_day":"false",
"starts_at":"2015-05-07T00:00:00.0000000",
"ends_at":"2015-05-12T00:00:00.0000000",
"remind_at":"2015-05-06T00:00:00.0000000",
"subscribers":"all",
"private":"false"
}
After I POST that information to the "new" Basecamp API the dates are not correct. Here are the dates that I receive back for the newly created Calendar Event:
"starts_at":"2015-05-06T20:00:00.000-04:00",
"ends_at":"2015-05-06T20:00:00.000-04:00",
"remind_at":"2015-05-05T20:00:00.000-04:00"
Not sure why the date values are off. I am assuming the dates are in proper format since I am not getting a 400 status code back.
Any help would be appreciated.
Here is a link to their documentation: https://github.com/basecamp/bcx-api/blob/master/sections/calendar_events.md
Thanks!
Upvotes: 0
Views: 204
Reputation: 241
If you change the format of the starts_at
, ends_at
and reminds_at
to the following, you should get the times you expect:
"starts_at":"2015-05-07T00:00:00-00:00",
"ends_at":"2015-05-12T00:00:00-00:00",
"remind_at":"2015-05-06T00:00:00-00:00",
You could pass the timezone of the user instead if the event is to start at midnight local time:
"starts_at":"2015-05-07T00:00:00-04:00",
"ends_at":"2015-05-12T00:00:00-04:00",
"remind_at":"2015-05-06T00:00:00-04:00",
Upvotes: 0