date format issue

5 posts, 0 answers
  1. mww
    mww avatar
    257 posts
    Member since:
    Sep 2012

    Posted 22 Sep 2009 Link to this post

    in the global.asax file, ive set the current culture as below

     

    protected void Application_BeginRequest(object sender, EventArgs e)

     

    {

     

    Thread.CurrentThread.CurrentUICulture = new CultureInfo("en-GB");

     

     

    Thread.CurrentThread.CurrentCulture = new CultureInfo("en-GB");

     

    }



    in my .aspx page, I have a date input like this

    <

     

    telerik:RadDatePicker ID="RadDatePickerNewsDate" runat="server" Calendar-CultureInfo="English (United Kingdom)" MinDate="01/01/2000 00:00:00" SkinID="Vista">

     

     

    </telerik:RadDatePicker>

     



    in my codebehind, I set the default date like this

    this

     

    .RadDatePickerNewsDate.SelectedDate = DateTime.Now;

     



    and the date comes out in American format.  Why is this ?   eg 09/22/2009

  2. mww
    mww avatar
    257 posts
    Member since:
    Sep 2012

    Posted 22 Sep 2009 Link to this post

    even when I select a date from the popup calendar, its still in US format, how can this be changed ?????
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Daniel
    Admin
    Daniel avatar
    4946 posts

    Posted 23 Sep 2009 Link to this post

    Hello Mark,

    Could you please try to set the Culture directly on your RadDatePicker?
    <telerik:RadDatePicker ID="RadDatePicker1" runat="server" Culture="en-GB"
        ... 
    </telerik:RadDatePicker> 

    Let me know whether this helps.

    Kind regards,
    Daniel
    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.
  5. mww
    mww avatar
    257 posts
    Member since:
    Sep 2012

    Posted 24 Sep 2009 Link to this post

    whats the difference between this

    Calendar-CultureInfo="English (United Kingdom)"

    and this

    Culture="en-GB"

  6. Daniel
    Admin
    Daniel avatar
    4946 posts

    Posted 29 Sep 2009 Link to this post

    Hello Mark,

    Calendar-CultureInfo applies to the nested control only(Calendar), unlike the second approach that will affect the whole control.

    Kind regards,
    Daniel
    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
UI for ASP.NET Ajax is Ready for VS 2017