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

DateFormat while Click on the particular date on RadCalendar

2 Answers 49 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
Brown
Top achievements
Rank 1
Brown asked on 06 Jan 2011, 07:42 PM
Hi ,

 I am using radcalendar in my app. while click on the date, calling ondateclick function.. in that function returing the value like "2011,1,12"
 but i need to display "January 3, 2011" Tell me how to do?

2 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 07 Jan 2011, 09:23 AM
Hello Brown,

You can achieve this by using  the DateTimeFormatInfo object which is used by the RadCalendar control for formatting date and time values

Here is the sample code:

JavaScript:
function OnDateClick(sender, args)
{
       var calendar = $find("<%= RadCalender1.ClientID %>");
       var selectedDate=args.get_renderDay().get_date();
       var LongDatePattern= calendar.DateTimeFormatInfo.LongDatePattern;
       var formattedDate = calendar.DateTimeFormatInfo.FormatDate(selectedDate, LongDatePattern);
       alert(formattedDate);
 }
 
Please go through the following article for more on this.
DateTimeFormatInfo

Shinu.
0
Brown
Top achievements
Rank 1
answered on 10 Jan 2011, 06:06 PM
Hi shinu,

 Thank you..

I need small question... I have a list of holidays based on month wise for the year (in the Stored Procedure).. need to display the holiday on the particular date... Could you please let me know how to do this......
Tags
Calendar
Asked by
Brown
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Brown
Top achievements
Rank 1
Share this question
or