question

justin-nguyen11499 avatar image
justin-nguyen11499 asked justin-nguyen11499 answered

Due time don't work in Create Task in Glip

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

message
1 comment
1 |3000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

justin-nguyen11499 avatar image justin-nguyen11499 commented ·

Please help me solve this problem !

0 Likes 0 ·
Phong Vu avatar image
Phong Vu answered justin-nguyen11499 commented

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.

1 |3000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

justin-nguyen11499 avatar image
justin-nguyen11499 answered Phong Vu commented

- But time in dueDate cannot apply

1 comment
1 |3000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Phong Vu avatar image Phong Vu ♦♦ commented ·

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.

0 Likes 0 ·
justin-nguyen11499 avatar image
justin-nguyen11499 answered

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

1 |3000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Developer sandbox tools

Using the RingCentral Phone for Desktop, you can dial or receive test calls, send and receive test SMS or Fax messages in your sandbox environment.

Download RingCentral Phone for Desktop:

Tip: switch to the "sandbox mode" before logging in the app:

  • On MacOS: press "fn + command + f2" keys
  • On Windows: press "Ctrl + F2" keys