Due time don't work in Create Task in Glip
Tags: message
Sep 21, 2020 at 11:50pm • 4 replies • 0 likes
justin-nguyen
- When I create Task For Glip by call api by JavaScript SDK , in document I see Due date property includes date and time.But I try make body same format and sent api, so due time don't set in Glip.
- I tried with your endpoint test in document, result is same.
Please help me check this case, thanks !
justin-nguyen on Nov 26, 2020 at 5:09pm • 0 likes
Please help me solve this problem !
3 Answers
The Glip server takes the start and due date/time in UTC time zone. You have to convert your startDate and dueDate from local time to UTC time. For example, PST time zone is UTC-8. The date and time can be converted using JavaScript as follow:
var localTimeZoneOffset = 8*3600*1000 var sd = new Date("2020-12-02T12:00:00.000Z").getTime() sd += localTimeZoneOffset var dd = new Date("2020-12-06T13:00:00.000Z").getTime() dd += localTimeZoneOffset var startDate = new Date(sd).toISOString() var dueDate = new Date(dd).toISOString() // var params = { subject: "Discuss new API", assignees: [ {id: "xxxxxx"}, {id: "xxxxxx"} ], completenessCondition: "Simple" startDate: startDate, dueDate: dueDate, color: "Red", section: "RnD", description: "Discuss with team of new API" } var resp = await platform.post(endpoint, params) var jsonObj = await resp.json() console.log(jsonObj)
This should create the correct date and time.
0
justin-nguyen on Dec 1, 2020 at 12:17am • 0 likes
Thanks, it work !
A new Community is coming to RingCentral!
Posts are currently read-only as we transition into our new platform.We thank you for your patience
during this downtime.
Try Workflow Builder
Did you know you can easily automate tasks like responding to SMS, team messages, and more? Plus it's included with RingCentral Video and RingEX plans!Try RingCentral Workflow Builder