jQWidgets Forums

Forum Replies Created

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts

  • Harrobbed
    Participant

    Will it not work if I create an ALL DAY appointment with a time component.

    For example:

    start: 2016-11-16T03:30:00.000Z
    end : 2016-11-16T03:30:00.000Z

    should my ALL DAY appointment look like this:

    start :2016-11-16
    end : 2016-11-16


    Harrobbed
    Participant

    I am manipulating my dates as such…

    if (serverAppointment.IsAllDay) {
    serverAppointment.StartDate = new Date(jsAppointment.from.year(),
    jsAppointment.from.month() – 1,
    jsAppointment.from.day(),
    00,
    00,
    00);
    serverAppointment.EndDate = new Date(jsAppointment.to.year(),
    jsAppointment.to.month() – 1,
    jsAppointment.to.day(),
    00,
    00,
    00);
    }

    then I send both the start date and end date to the server by converting them to ISO format like this:

    //apply timezone

    serverAppointment.StartDate = new Date(serverAppointment.StartDate.getTime() + ((timeZoneOffset * -1) -serverAppointment.StartDate.getTimezoneOffset()) * 60000); //where timeZoneOffset is -210

    serverAppointment.EndDate = new Date(serverAppointment.EndDate.getTime() + ((timeZoneOffset * -1) – serverAppointment.EndDate.getTimezoneOffset()) * 60000); //where timeZoneOffset is -210

    // convert to ISO

    serverAppointment.StartDate = serverAppointment.StartDate.toISOString(); // this results in “2016-11-16T03:30:00.000Z”
    serverAppointment.EndDate = serverAppointment.EndDate.toISOString(); // this results in “2016-11-16T03:30:00.000Z”

    Thanks.

    Harrobbed

Viewing 2 posts - 1 through 2 (of 2 total)