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

How to deal with various date formats?

3 Answers 141 Views
DatePicker
This is a migrated thread and some comments may be shown as answers.
mike massing
Top achievements
Rank 1
mike massing asked on 30 Apr 2009, 01:44 PM
Hello telerik team,

Could you pls tell me if there exist any way by which the Date-picker shows the selected date in the text box in a prescribed format like "12-jul-2009" instead of dd/mm/yyyy format that it generally takes?

Any sample application featuring this is much appreciated..

Regards
Mike

3 Answers, 1 is accepted

Sort by
0
Accepted
Konstantin Petkov
Telerik team
answered on 05 May 2009, 07:43 AM
Hello Mike,

Thank you for your question.

You can easily change the date format in RadDatePicker through its Culture property. You need to define a CultureInfo object and tweak it as per your requirements:

            CultureInfo cultureInfo = new CultureInfo("en-US"); 
            DateTimeFormatInfo dateInfo = new DateTimeFormatInfo(); 
            dateInfo.ShortDatePattern = "dd-MM-yyyy"
            cultureInfo.DateTimeFormat = dateInfo; 
            RadDatePicker1.Culture = cultureInfo;  


Kind regards,
Konstantin Petkov
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Jack
Top achievements
Rank 1
answered on 30 Sep 2009, 01:16 AM

HI

We do this, it work well but our need a format display string like like MMM dd and there no year in it, we replace the "MM/dd/yyyy" with "MMM dd" and it will crash. what can I do ? Wait it online.

 

Thanks

Jack

Insignia.

 

 

0
Kaloyan
Telerik team
answered on 02 Oct 2009, 11:29 AM
Hello Jack,

Please accept our apologies. The problem with your date time format is that it doesn't contain a year definition. The yeas is needed for the RadCalendar, displayed in the popup. This is the reason you are getting the exception. We will consider some improvements in this direction. Let us know if you need further assistance.

Kind regards,
Kaloyan
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
DatePicker
Asked by
mike massing
Top achievements
Rank 1
Answers by
Konstantin Petkov
Telerik team
Jack
Top achievements
Rank 1
Kaloyan
Telerik team
Share this question
or