Skip to main content
The First Step
September 22, 2020
Question

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 !

    5 replies

    The First Step
    November 27, 2020

    Please help me solve this problem !

    PhongVu
    Community Manager
    Community Manager
    November 30, 2020

    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.

    The First Step
    December 1, 2020

    - But time in dueDate cannot apply

    PhongVu
    Community Manager
    Community Manager
    December 1, 2020

    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.

    The First Step
    December 2, 2020

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