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

Appointment get displayed in wrong date only in monthview

1 Answer 65 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
nallamani
Top achievements
Rank 1
nallamani asked on 18 Dec 2008, 03:25 PM

Hi Guys,
       Please dont ask to rise the support ticket.We have the original version and I am not the registered user for this control.
I am having  a problem with the Scheduler not showing a new appointment in the correct time slot. I am using Rad prompt window for adding and editing the appointment.

 It is working fine in day and week view I have problem in Month and timeline view.
It is being updated to the wrong date I mean to the previous date.

 

var

SchedulerInsertMode = null;

 

 

var ScheduleID = null;

 

 

var startTime = new Date();

 

 

var endTime = new Date();

 

 

function OnClientAppointmentInserting(sender, eventArgs)

 

{ SchedulerInsertMode =

true;

 

ScheduleID = sender.get_id().split(

"_")[sender.get_id().split("_").length-1];

 

PresentSchudler = sender;

newAppointment =

new Telerik.Web.UI.SchedulerAppointment();

 

startTime = eventArgs.get_targetSlot().get_startTime();

endTime =

new Date(startTime);

 

 

 

// alert(getTimeSlotFromDomElement())

// var now = new Date();

// if (eventArgs.get_startTime() < now)

// {

// alert("Appointment Cannot be inserted!")

// eventArgs.set_cancel(true);

// }

// else

// {

 

 

openPrompt(

"Appointment :")

 

eventArgs.set_cancel(

true);

 

 

return false;

 

 

 

// }

 

 

}

 

var AppointID=null

 

 

 

 

function OnClientAppointmentEditing(sender, eventArgs)

 

{ SchedulerInsertMode =

false;

 

PresentSchudler = sender;

ScheduleID = sender.get_id().split(

"_")[sender.get_id().split("_").length-1];

 

newAppointment =

new Telerik.Web.UI.SchedulerAppointment();

 

 

var apt = eventArgs.get_appointment();

 

AppointID=apt.get_id()

 

 

// var wnd=window.radopen("Appointment.aspx?Mode=Edit&AppointmentId=" + apt.get_id() + "&CID=" + <%= Request.QueryString("CID") %>, "AdvancedForm");

// wnd.setSize(460,180);

// wnd.add_pageLoad(function(){wnd.set_status(" "); });

 

 

openPrompt(

"Appointment : (<i>" + apt.get_subject() + "</i>)")

 

eventArgs.set_cancel(

true);

 

 

return false;

 

}

 

function formatDate(date)

 

{

 

var year = padNumber(date.getUTCFullYear(), 4);

 

 

var month = padNumber(date.getUTCMonth() + 1, 2);

 

 

var day = padNumber(date.getUTCDate(), 2);

 

 

var hour = padNumber(date.getHours(), 2);

 

 

var minute = padNumber(date.getMinutes(), 2);

 

 

return year + "/" + month + "/" + day +" "+ hour + ":" + minute;

 

}

 

function padNumber(number, totalDigits)

 

{

number = number.toString();

 

var padding = '';

 

 

if (totalDigits > number.length)

 

{

 

for (i = 0; i < (totalDigits - number.length); i++)

 

{

padding +=

'0';

 

}

}

 

 

return padding + number.toString();

 

}

 

function OnClientAppointmentDeleting(sender, eventArgs)

 

{

 

var ClientName=document.getElementById("hidClientName").value

 

 

var apt = eventArgs.get_appointment();

 

 

var check= deleterecords(apt.get_id(),ClientName)

 

 

return false;

 

}

 

 

 

function openPrompt(Caption)

 

{

 

radprompt(Caption, callbackFn, 350, 80);

}

 

 

function callbackFn(arg)

 

{

endTime.setMinutes(endTime.getMinutes() + 60);

newAppointment.set_start(startTime);

newAppointment.set_end(endTime);

newAppointment.set_subject(arg);

PresentSchudler.insertAppointment(newAppointment);

 

startTime = formatDate(startTime);

endTime = formatDate(endTime)

 

if(SchedulerInsertMode)AppointmentInsert(document.getElementById("hidClientName").value, arg, startTime, endTime, ScheduleID)

 

 

else if(!SchedulerInsertMode)

 

AppointmentUpdate(document.getElementById(

"hidClientName").value,arg,AppointID)

 

document.forms[0].submit();

}

 

1 Answer, 1 is accepted

Sort by
0
T. Tsonev
Telerik team
answered on 22 Dec 2008, 12:27 PM
Hi,

Your code looks alright. What is the value of the TimeZoneOffset property of  RadScheduler? It should be left at its default value (00:00:00) when you do not need to convert times for customers from different time zones.

Sincerely yours,
Tsvetomir Tsonev
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Scheduler
Asked by
nallamani
Top achievements
Rank 1
Answers by
T. Tsonev
Telerik team
Share this question
or