This is a migrated thread and some comments may be shown as answers.

Cant get the exact time using get_startTime()

1 Answer 41 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
sotero
Top achievements
Rank 1
sotero asked on 24 Jan 2012, 10:29 PM
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.

1 Answer, 1 is accepted

Sort by
0
sotero
Top achievements
Rank 1
answered on 24 Jan 2012, 10:45 PM
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.
Tags
Scheduler
Asked by
sotero
Top achievements
Rank 1
Answers by
sotero
Top achievements
Rank 1
Share this question
or