Client-side appointment Start and End time problems

4 posts, 1 answers
  1. Corey Alguire
    Corey Alguire avatar
    43 posts
    Member since:
    Sep 2004

    Posted 24 Jun 2008 Link to this post

    I just updated to the service pack release of Q1 Ajax controls, and I now have a fairly urgent problem with my RadScheduler. I am using an object datasource and had nearly everything I needed working nicely with the previous version. I am doing a lot with integrated ContextMenus.

    After updating to the latest release, I can no longer seem to access date/time information for appointments in the Scheduler using the get_start() or get_end() methods. I seem to be accessing the appointment correctly, as code using get_id() is working fine. In addition, when I debug, the values I see for get_start() and get_end are both 'NaN'. The get_id() method is working fine, appointments render where they are supposed to- in general, everything looks right- but the start and end dates are just not accessible.
  2. T. Tsonev
    Admin
    T. Tsonev avatar
    2770 posts

    Posted 24 Jun 2008 Link to this post

    Hi Corey,

    I have just checked both the SP1 and SP2 versions and they both seem to work fine. Can you please send us the code that you are using to access the start and end time?

    Kind regards,
    Tsvetomir Tsonev
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Corey Alguire
    Corey Alguire avatar
    43 posts
    Member since:
    Sep 2004

    Posted 24 Jun 2008 Link to this post

    I have made some modifications to this for testing purposes since the problem cropped up, but here is my client-side script block:

    <

    telerik:RadScriptBlock runat="server" ID="RadScriptBlock1">

    <script type="text/javascript">

    var selectedAppointment = null;

    var isAllDayTimeSlot = null;

    var contextMenuSlot = null;

    function appointmentContextMenu(sender, eventArgs)

    {

    selectedAppointment = eventArgs.get_appointment();

    var menu = $find("<%= aptContextMenu.ClientID %>");

    var menuNoDel = $find("<%= aptContextMenuNoDelete.ClientID %>");

    var kl = selectedAppointment._attributes.getAttribute('KannLoeschen');

    if (kl != 'True')

    {

    menuNoDel.show(eventArgs.get_domEvent());

    }

    else{

    menu.show(eventArgs.get_domEvent());

    }

    }

    function appointmentContextMenuItemClicked(sender, eventArgs)

    {

    if (!selectedAppointment)

    return;

    switch (eventArgs.get_item().get_value())

    {

    case "Delete":

    doAjaxRequest(

    "Delete:" + selectedAppointment.get_id());

    break;

    case "Edit":

    doAjaxRequest(

    "Edit:" + selectedAppointment.get_id());

    break;

    case "Selection":

    alert(selectedAppointment.get_id());

    var start = selectedAppointment.get_start(); //convertToDateTime(selectedAppointment.get_start());

    var end = selectedAppointment.get_end(); //convertToDateTime(selectedAppointment.get_end());

    doAjaxRequest(

    "Selection:" + start + ':' + end);

    break;

    }

    selectedAppointment =

    null;

    }

    function appointmentClicked(sender, eventArgs)

    {

    var apt = eventArgs.get_appointment();

    var id = apt.get_id();

    var aType = id.substr(0,2);

    if (aType != "st")

    {

    doAjaxRequest(

    "Arzt:" + id);

    }

    }

    function timeSlotContextMenu(sender, eventArgs)

    {

    var menu = $find("<%= slotContextMenu.ClientID %>");

    menu.show(eventArgs.get_domEvent());

    isAllDayTimeSlot = eventArgs.get_isAllDay();

    contextMenuSlot = eventArgs.get_targetSlot();

    }

    function timeSlotContextMenuItemClicked(sender, eventArgs)

    {

    switch (eventArgs.get_item().get_value())

    {

    case "NewWunschbesuch":

    doAjaxRequest(

    "Wunschbesuch:" + contextMenuSlot._startTime.toLocaleString() + '|' + isAllDayTimeSlot);

    break;

    case "NewOther":

    doAjaxRequest(

    "AddOther:" + contextMenuSlot._startTime.toLocaleString() + '|' + isAllDayTimeSlot);

    break;

    case "Selection":

    var start = convertToDateTime(contextMenuSlot._startTime);

    doAjaxRequest(

    "Selection:" + start);

    break;

    }

    }

    function GVDateMove(dt)

    {

    doAjaxRequest(

    "DateMove:" + dt);

    }

    function doAjaxRequest(data)

    {

    var ajaxManager = $find("<%= RadAjaxManager1.ClientID %>");

    ajaxManager.ajaxRequest(data);

    }

    function convertToDateTime(date)

    {

    //var year = date.getUTCFullYear();

    //var month = date.getUTCMonth()+1;

    //var day = date.getUTCDate();

    //return day + '.' + month + '.' + year;

    return date;

    }

    function hideActiveToolTip()

    {

    var controller = Telerik.Web.UI.RadToolTipController.getInstance();

    var tooltip = controller.get_activeToolTip();

    if (tooltip)

    {

    tooltip.hide();

    }

    }

    function refreshScheduler()

    {

    var ajaxManager = $find("RadAjaxManager1");

    ajaxManager.ajaxRequest(

    'RebindScheduler');

    }

    Sys.WebForms.PageRequestManager.getInstance().add_beginRequest(beginRequestHandler);

    function beginRequestHandler(sender, args)

    {

    var prm = Sys.WebForms.PageRequestManager.getInstance();

    if (args.get_postBackElement().id.indexOf('rsWork') != -1 || args.get_postBackElement().id.indexOf('rcCalendar') != -1)

    {

    hideActiveToolTip();

    }

    }

    </script>

    </telerik:RadScriptBlock>

  5. Answer
    T. Tsonev
    Admin
    T. Tsonev avatar
    2770 posts

    Posted 24 Jun 2008 Link to this post

    Hello Corey,

    You are correct indeed. The problem was only visible when the server was in different locale than the en-US one that I have used for testing earlier. We have managed to fix it and you should open a support ticket, so we can send you the hotfix. Your Telerik points have been updated for your involvement.

    Sincerely yours,
    Tsvetomir Tsonev
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
Back to Top