How to deal with various date formats?

4 posts, 1 answers
  1. mike massing
    mike massing avatar
    5 posts
    Member since:
    Feb 2009

    Posted 30 Apr 2009 Link to this post

    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
  2. Answer
    Konstantin Petkov
    Admin
    Konstantin Petkov avatar
    1911 posts

    Posted 05 May 2009 Link to this post

    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.
  3. DevCraft banner
  4. Jack
    Jack avatar
    6 posts
    Member since:
    Jun 2008

    Posted 29 Sep 2009 Link to this post

    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.

     

     

  5. Kaloyan
    Admin
    Kaloyan avatar
    920 posts

    Posted 02 Oct 2009 Link to this post

    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.
Back to Top