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

[Solved] Telerik Calendar Control Bug/Issue - Didn't return selected Date

1 Answer 81 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
USMAN
Top achievements
Rank 2
USMAN asked on 18 Apr 2012, 04:57 PM
Hi, 

I have found a bug/issue in Telerik Calendar Control.

i am using Calendar's OnChange event to get the selected date.

it didn't return the selected date on selection. it returns the last selected date when you click on new date.

When the calendar control loads , and I try to click on any date ( it should display me the selected Date) BUT it Display null value.

see the image named "nullvalue_onfirstselection.jpg"

and If I have selected date: 19/04/2012 and and I click on date 21/04/2012 (it should display 21/04/2012) BUT it display the last selected date i.e. 19/04/2012

see the image named "displaywrong_selecteddate.jpg" 

I have also attached the complete source code

1 Answer, 1 is accepted

Sort by
0
Georgi Krustev
Telerik team
answered on 20 Apr 2012, 03:15 PM
Hello Usman,

 
This is expected behavior. The new date is passed to the event handler through arguments. Here how you need to modify the event handler:

function MyCal_OnChange(e) {
 
        var calendar = $(this).data("tCalendar");
        var selectedDate = e.date;
        var dateString = $.telerik.formatString('{0:dd/MM/yyyy}', selectedDate);
        alert("Selected Date = " + dateString);
 
    }

Kind regards,
Georgi Krustev
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the Telerik Extensions for ASP.MET MVC, subscribe to their blog feed now.
Tags
Calendar
Asked by
USMAN
Top achievements
Rank 2
Answers by
Georgi Krustev
Telerik team
Share this question
or