Skip to main content

- 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 !

Please help me solve this problem !


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.


- But time in dueDate cannot apply


Why cannot apply? Hey, your question is very vague and this would take lots of time to go back and forth. Do explain with details if you want to get help.


- I have convert dueTime to UTC, dueTime contain date and time. But after task creation completed, I saw task's dueTime only contained date and ignored time in Ringcentral App.

- Then I click into edit task, I saw empty value in field time.


Reply