Cant get the exact time using get_startTime()

2 posts, 0 answers
  1. sotero
    sotero avatar
    9 posts
    Member since:
    Oct 2012

    Posted 24 Jan 2012 Link to this post

    I have a RadScheduler with intervals of 30 minutes.
    I am trying to validate when the user moves an appointmente to another timeslot. I am using OnClientAppointmentMoveEnd to check the new timeslot and the new startime.
    The problem is that when the user drags the appointment to, for example, 15:30, the "eventArgs.get_newStartTime()" returns "15:01".
    If it drags to slot "15:00" it also shows "15:01". Why is that?
    Here is a sample code where I am just trying to show a message asking the user to confirm the changes in the schedule and in the resource.

    function OnClientAppointmentMoveEnd(sender, eventArgs) {
                     
                    var apt = eventArgs.get_appointment();
                    var msg = "";
                    var novadata = eventArgs.get_newStartTime();
                    if (apt.get_start() != novadata) {
                        msg = "New Schedule:" + novadata.format("HH:MM") + "\r\n";
                    }
     
                    if (apt.get_timeSlot().get_resource(0).get_key() != eventArgs.get_targetSlot().get_resource(0).get_key()) {
                        msg = msg + "New therapist:" + eventArgs.get_targetSlot().get_resource(0).get_text() + "\r\n";
                    }
     
                    if (confirm(msg + "Confirm change?" )) {
                     
                    }
                    else {
                        set_cancel(true);
                    }
                   
                     
                                     
                }

    Any ideia? Thanks.
  2. sotero
    sotero avatar
    9 posts
    Member since:
    Oct 2012

    Posted 24 Jan 2012 Link to this post

    Please forget it. I found the problem. It´s ridiculous. The problem is the javascript format function that I am using in this code. I am passing the parameter "MM" instead of "mm" and that´s why It is showing always "01" (January).
    It is working fine now.
    Sometimes we need to talk/write to someone to solve the problem by ourselves.
Back to Top