I don't know what I am doing wrong but I basically display a RadCalendar for a range selection:
the following code executes when onDateClick handler executes
The problem is that the value of the textbox is set to: "0undefined/0undefined/undefined" (returned by the FormatDate() method).
If I take a look at the startDate value in the watch window it says: "Thu Jun 13 00:00:00 EDT 2013"
However when I expand the startDate instance there's a [prototype] child with a value of "Invalid Date"
Is this normal behavior? Why isn't the formatting working?
Thank you.
<telerik:RadCalendar runat="server" ID="RadCalendar1" RangeSelectionMode="ConsecutiveClicks" EnableViewSelector="True" EnableKeyboardNavigation="True" SelectedDate="" Skin="Metro"> <ClientEvents OnDateClick="onDateClick"></ClientEvents> <WeekendDayStyle CssClass="rcWeekend" /> <CalendarTableStyle CssClass="rcMainTable" /> <OtherMonthDayStyle CssClass="rcOtherMonth" /> <OutOfRangeDayStyle CssClass="rcOutOfRange" /> <DisabledDayStyle CssClass="rcDisabled" /> <SelectedDayStyle CssClass="rcSelected" /> <DayOverStyle CssClass="rcHover" /> <FastNavigationStyle CssClass="RadCalendarMonthView RadCalendarMonthView_Metro" /> <ViewSelectorStyle CssClass="rcViewSel" /> </telerik:RadCalendar>the following code executes when onDateClick handler executes
var rangeText = $("#RangeText");var rc = $find("RadCalendar1");var startDate = rc.get_rangeSelectionStartDate();var datepattern = 'MM/dd/yyyy';rangeText[0].value = rc.DateTimeFormatInfo.FormatDate(startDate, datepattern);The problem is that the value of the textbox is set to: "0undefined/0undefined/undefined" (returned by the FormatDate() method).
If I take a look at the startDate value in the watch window it says: "Thu Jun 13 00:00:00 EDT 2013"
However when I expand the startDate instance there's a [prototype] child with a value of "Invalid Date"
Is this normal behavior? Why isn't the formatting working?
Thank you.