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

FIX: Clicking the date header in week view results in a server-side exception

1 Answer 74 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Telerik Admin
Top achievements
Rank 1
Iron
Telerik Admin asked on 25 May 2010, 02:58 PM

The exception is "FormatException: String was not recognized as a valid DateTime"

The issue is fixed in build 2010.1.526 and later. A workaround is to include the following script below the ScriptManager/RadScriptManager instance on the page:

<script type="text/javascript">
Telerik.Web.UI.RadScheduler.prototype._onDateHeaderClick = function (e)
{
    $telerik.cancelRawEvent(e);
      
    var date = new Date();
    // Date headers have an href in the format #yyyy-MM-dd
    var dateMatch = e.eventMapTarget.href.match(/#(\d{4}-\d{2}-\d{2})/);
    if (dateMatch && dateMatch.length == 2)
    {
        var parts = $telerik.$.map(dateMatch[1].split("-"), function (part) { return parseInt(part, 10); });
        date = new Date(parts[0], parts[1] - 1, parts[2]);
    }
      
    return this._switchToSelectedDay(date);
};
</script>

1 Answer, 1 is accepted

Sort by
0
pucsoftware
Top achievements
Rank 1
answered on 07 Sep 2010, 06:29 PM
Thanks for the code and fix. I was getting this error and this solved the issue.
Tags
Scheduler
Asked by
Telerik Admin
Top achievements
Rank 1
Iron
Answers by
pucsoftware
Top achievements
Rank 1
Share this question
or